Random accessible image data compression

ABSTRACT

Methods and compression units for compressing a block of image data, the block of image data comprising a plurality of image element values, the image element values being divisible into at least a first value and a second value such that the block of image data comprises a two-dimensional block of first values, the method comprising: compressing a first data set comprising all or a portion of the two-dimensional block of first values in accordance with a first fixed-length compression algorithm to generate a first compressed block by: identifying common base information for the first data set; and identifying a fixed-length parameter for each first value in the first data set, the fixed-length parameter being zero, one or more than one bits in length; and forming a compressed block for the block of image data based on the first compressed block.

BACKGROUND

Data compression, both lossless and lossy, is desirable in manyapplications in which data is to be stored in, and/or read from memory.By compressing data before storage of the data in memory, the amount ofdata transferred to the memory may be reduced. An example of data forwhich data compression is particularly useful is image data. The term‘image data’ is used herein to refer to two-dimensional data that has avalue corresponding to each pixel or each sample location of an imagethat is produced as part of a rasterization process on a GraphicsProcessing Unit (GPU). Image data includes, but is not limited to, depthdata to be stored in a depth buffer, pixel data (e.g. colour data) to bestored in a frame buffer, texture data to be stored in a texture bufferand surface normal data to be stored in a surface normal buffer. Thesebuffers may be any suitable type of memory, such as cache memory,separate memory subsystems, memory areas in a shared memory system orsome combination thereof.

A GPU may be used to process data in order to generate image data. Forexample, a GPU may determine pixel values (e.g. colour values) of animage to be stored in a frame buffer which may be output to a display.GPUs usually have highly parallelised structures for processing largeblocks of data in parallel. There is significant commercial pressure tomake GPUs (especially those intended to be implemented onmobile/embedded devices) operate at lower power levels. Competingagainst this is the desire to use higher quality rendering algorithms onfast GPUs, which thereby puts pressure on a relatively limited resource:memory bandwidth. However, increasing the bandwidth of the memorysubsystem might not be an attractive solution because moving data to andfrom, and even within, the GPU consumes a significant portion of thepower budget of the GPU. The same issues may be relevant for centralprocessing units (CPUs) as well as GPUs.

FIG. 1 shows an example graphics rendering system 100 which may beimplemented in an electronic device, such as a mobile/embedded device.The graphics rendering system 100 comprises a host CPU 102, a GPU 104, amemory 106 (e.g. graphics memory) and a display 108. The CPU 102 isconfigured to communicate with the GPU 104. Data, which may becompressed data, can be transferred in either direction, between the GPU104 and the memory 106. Images (e.g. pixel data) which are rendered bythe GPU 104 may be stored in memory 106 and displayed on the display 108via a display interface 116.

The GPU 104 comprises a rendering unit 110, a compression/decompressionunit 112, and a memory interface 114. The graphics rendering system 100is arranged such that data can pass, in either direction, between (i)the CPU 102 and the rendering unit 110; (ii) the CPU 102 and the memoryinterface 114; (iii) the memory interface 114 and the memory 106; (iv)the rendering unit 110 and the compression/decompression unit 112; (v)the compression/decompression unit 112 and the memory interface 114; and(vi) the memory 106 and the display interface 116. In some examples, thegraphics rendering system 100 may be further arranged such that data canpass to and from the compression/decompression unit 112 to the displayinterface 116, and such that data can pass from the display interface116 to the display 108.

In operation, the GPU 104 processes regions of image data individually.The regions may for example represent rectangular (including square)portions of the render space (i.e. the two-dimensional spacerepresenting, for example, an image area to be rendered). The renderingunit 110 may perform scan conversion and rasterization of graphicsprimitives, such as, but not limited to, triangles and lines, usingknown techniques such as Z-tests and texture mapping. The rendering unit110 may contain cache units to reduce memory traffic. Some data is reador written by the rendering unit 110, to the memory 106 via the memoryinterface 114 (which may include a cache) but for other data, such asdata to be stored in a buffer, such as the frame buffer, the datapreferably goes from the rendering unit 110 to the memory interface 114via the compression/decompression unit 112. Thecompression/decompression unit 112 reduces the amount of data that is tobe transferred across the external memory bus to the memory 106 bycompressing the data.

The display interface 116 sends data defining a completed image to thedisplay 108. An uncompressed image may be accessed directly from thememory 106. Compressed data may be decompressed via thecompression/decompression unit 112 and sent as uncompressed data to thedisplay 108. In alternative examples the compressed data could be readdirectly by the display interface 116 and the display interface 116could include logic for decompressing the compressed data in anequivalent manner to the decompression of the compression/decompressionunit 112. Although shown as a single entity, thecompression/decompression unit 112 may contain multiple parallelcompression and/or decompression units for enhanced performance.

As is known to a person of skill in the art, the rendering unit 110 maygenerate a set of one or more colour values (e.g. RGB or RGBA) for eachpixel in the render space and store the colour values in the framebuffer. The collection of colour values for a frame may be referred toherein as colour data, image data, frame buffer data or simply framedata. The rendering unit 110 may also generate other image data, such asdepth data, surface normal data, lighting data, etc., and may storethose image data values in one or more buffers in memory. These buffersmay, in some cases, be referred to as frame buffers, while in othercases the term “frame buffer” may be reserved for buffers which storecolour values or which store data to be sent to the display. In somegraphics rendering systems the image data values stored in a buffer fora particular render may be used by the rendering unit 110 to render oneor more subsequent frames. For example, colour values generated by onerender may be used as texture values in the rendering of one or moresubsequent frames, and surface normal values generated for a geometricmodel in one render may be used to apply lighting effects to the samemodel during the rendering of one or more subsequent frames.

Since the image data (e.g. colour data) can be quite large the memorybandwidth associated with writing image data to a buffer in memory andreading the image data from the buffer in memory may be a significantportion of the total memory bandwidth of the graphics processing systemand/or the GPU. As a result, the image data is often compressed, via thecompression/decompression unit 112, prior to being stored in a bufferand decompressed, via the compression/decompression unit 112, afterbeing read from the buffer. Since image data often comprises colourdata, compression methods may be designed to suit the particularcharacteristics of colour image data. In other examples, compressionmethods may be designed for the different characteristics of depth data,or surface normal data.

Known lossless methods for compressing colour data, such as thosedescribed in the Applicant's UK Patents 2451911, 2530312 and 2530311,are configured to divide the colour data into blocks and compress eachblock individually in a manner that requires the whole block to bedecompressed together. For example, in these compression methods an 8×8pixel block of colour values may be compressed together. Then to accessany particular colour value in that block the whole 8×8 pixel block hasto be decompressed.

However, the rendering unit 110 doesn't typically need all the data(e.g. colour values) in a block for rendering a subsequent frame. Forexample, the rendering unit 110 may only need colour values related to afew pixels in a block. Accordingly, having to decompress a whole blockto access only a small number of colour values in that block can makeaccessing the colour data in the frame buffer inefficient for therendering unit 110.

Attempts have been made to address this problem by caching thedecompressed blocks, but in many cases having a cache doesn'tsignificantly improve the efficiency of accessing the data (e.g. colourvalues) in the frame buffer. Other attempts made to address this probleminclude reducing the block sizes (e.g. reducing the block size to a 4×4block of colour values), but the inefficiency of having to decompress awhole block to access the colour values for a few pixels has shown toexist at any block level and the smaller the blocks the less efficientthe compression is.

The embodiments described below are provided by way of example only andare not limiting of implementations which solve any or all of thedisadvantages of known image data compression and/or decompressionmethods.

SUMMARY

This summary is provided to introduce a selection of concepts that arefurther described below in the detailed description. This summary is notintended to identify key features or essential features of the claimedsubject matter, nor is it intended to be used to limit the scope of theclaimed subject matter.

Described herein are methods and compression units for compressing ablock of image data, the block of image data comprising a plurality ofimage element values, the image element values being divisible into atleast a first value and a second value such that the block of image datacomprises a two-dimensional block of first values, the methodcomprising: compressing a first data set comprising all or a portion ofthe two-dimensional block of first values in accordance with a firstfixed-length compression algorithm to generate a first compressed blockby: identifying common base information for the first data set; andidentifying a fixed-length parameter for each first value in the firstdata set, the fixed-length parameter being zero, one or more than onebits in length; and forming a compressed block for the block of imagedata based on the first compressed block.

A first aspect provides a method of compressing a block of image data,the block of image data comprising a plurality of image element values,the image element values being divisible into at least a first value anda second value such that the block of image data comprises atwo-dimensional block of first values, the method comprising:compressing a first data set comprising all or a portion of thetwo-dimensional block of first values in accordance with a firstfixed-length compression algorithm to generate a first compressed blockby: identifying common base information for the first data set; andidentifying a fixed-length parameter for each first value in the firstdata set, the fixed-length parameter being zero, one or more than onebits in length; and forming a compressed block for the block of imagedata based on the first compressed block.

The first data set may comprise a first portion of the two-dimensionalblock of first values, and the method may further comprise compressing asecond data set comprising a second portion of the two-dimensional blockof first values in accordance with a second fixed-length compressionalgorithm to generate a second compressed block, and wherein thecompressed block for the block of image data is further based on thesecond compressed block.

The first and second fixed-length compression algorithms may bedifferent.

The first and second data sets may be different sizes.

The method may further comprise sub-dividing the two-dimensional blockof first values into a plurality of sub-blocks, and wherein the firstdata set is one of the plurality of sub-blocks.

The method may further comprise, prior to compressing the first dataset, selecting the first data set by: sub-dividing the two-dimensionalblock of first values into a plurality of sub-blocks; determiningwhether one of the sub-blocks can be suitably compressed using afixed-length compression algorithm; in response to determining that theone of the sub-blocks can be suitably compressed using a fixed-lengthcompression algorithm, selecting the one of the sub-blocks as the firstdata set; and in response to determining that the one of the sub-blockscannot be suitably compressed using a fixed-length compressionalgorithm, sub-dividing the one of the sub-blocks into a plurality ofmini-blocks and selecting one of the mini-blocks as the first data set.

The method may further comprise, prior to compressing the first dataset, selecting the first data set by: determining whether thetwo-dimensional block of first values can be suitably compressed using afixed-length compression algorithm; in response to determining that thetwo-dimensional block of first values can be suitably compressed using afixed-length compression algorithm, selecting the two-dimensional blockof first values as the first data set; and in response to determiningthat the two-dimensional block of first values cannot be suitablycompressed using a fixed-length compression algorithm, sub-dividing thetwo-dimensional block of first values into a plurality of sub-blocks andselecting one of the sub-blocks as the first data set.

Determining whether a block or sub-block of values can be suitablycompressed using a fixed-length compression algorithm may comprisedetermining whether a size of the compressed block or sub-block when theblock or sub-block is compressed in accordance with the fixed-lengthcompression algorithm is less than or equal to a predeterminedthreshold.

The block of image data may further comprise a two-dimensional block ofsecond values.

Each value in the two-dimensional block of second values may be a colourvalue for a second colour channel.

The method may further comprise: compressing a third data set comprisingall or a portion of the two-dimensional block of second values using athird fixed-length compression algorithm to generate a third compressedblock by: identifying common base information for the third data set;and identifying a fixed-length parameter for each second value in thethird data set, the fixed-length parameter being zero, one or more thanone bits in length; and wherein the compressed block for the block ofimage data is further based on the third compressed block.

The first and third fixed-length compression algorithms may bedifferent.

Each first value and each second value may correspond to a pixel. Thecompressed block for the block of image data may comprises a pixel dataunit for each pixel, the pixel data unit comprising: first datarepresenting the first value in the two-dimensional block of firstvalues corresponding to that pixel, the first data comprising the firstvalue or a fixed-length parameter for that first value generated inaccordance with a fixed-length compression algorithm; and second datarepresenting the second value in the two-dimensional block of secondvalues corresponding to that pixel, the second data comprising thesecond value or a fixed-length parameter for that second value generatedin accordance with a fixed-length compression algorithm.

The pixel data units may be grouped into blocks and the first data ofeach pixel data unit in a block may be the same size and the second dataof each pixel data unit in a block may be the same size.

Each block of pixel data units may comprise X pixel data units; thefirst data set may comprise Y values of the two-dimensional block offirst values; and X is an integer greater than or equal to two and Y isan integer multiple of X.

The method may further comprise: analysing the first values in the firstdata set to generate one or more diversity statistics; and selecting oneof a plurality of fixed-length compression algorithms to be the firstfixed-length compression algorithm based on the one or more diversitystatistics.

The one or more diversity statistics may include one or more of: a rangeof values in the first data set, a minimum value in the first data set,a maximum value in the first data set, and a number of unique values inthe first data set.

If each value of the first data set is the same and matches one of oneor more predetermined values, the common base information may compriseinformation identifying the one of the one or more predetermined valuesand the fixed-length parameter for each value may have zero bits.

The one or more predetermined values may comprise only a single valueand the information identifying the one of the one or more predeterminedvalues may comprise information identifying a particular fixed-lengthcompression algorithm was used to compress the first data set.

The one or more predetermined values may comprise a plurality of values.

At least a portion of the plurality of values may be dynamicallyconfigurable.

At least a portion of the plurality of values may be fixed.

The block of image data may further comprise a two-dimensional block ofsecond values; and if all of the values of the first data set are thesame and match a first predetermined value, and all the values of athird data set are the same and match a second predetermined value,wherein the third data set comprises the second values of thetwo-dimensional block of second values corresponding to the values inthe first data set, then the common base information may compriseinformation identifying the first and second predetermined values andthe fixed-length parameters may have zero bits.

The common base information may comprise an origin based on the valuesin the first data set and the fixed-length parameter for each value maycomprise a difference between the value and the origin.

The origin may be a minimum value in the first data set.

A size of the fixed-length parameter may be based on a range of valuesin the first data set.

The range may be selected as a smallest range according to modulo marithmetic wherein m is 2^(x) and each value in the two-dimensionalblock of first values comprises x bits.

The common base information may comprise a plurality of origins based onthe values in the first data set and the fixed-length parameter for eachvalue may comprise an index identifying one of the plurality of originsand a difference between the value and that origin.

The common base information may comprise a look-up table of uniquevalues in the first data set and the fixed-length parameter for a valuemay comprise an index to the look-up table.

If all the values in the first data set are the same, the common baseinformation may comprise that common value and the fixed-lengthparameter for each value may have zero bits.

The method may further comprise forming a header for the compressedblock of image data, wherein the header comprises the common baseinformation and information that indicates a size of the fixed-lengthparameter.

The header may further comprise information indicating the firstfixed-length compression algorithm.

Each image element value may be a colour value.

Each value in the two-dimensional block of first values may be a colourvalue for a first colour channel.

The block of image data may comprise image data generated by arasterization process on a graphics processing unit.

The first value may be a multi-bit value and the second value may be amulti-bit value.

The first value may be an eight-bit value and the second value may be aneight-bit value.

The method may further comprise storing the compressed block for theblock of image data in memory.

A second aspect provides a compression unit to compress a block of imagedata, the block of image data comprising a plurality of image elementvalues, the image element values being divisible into at least a firstvalue and a second value such that the block of image data comprises atwo-dimensional block of first values, the compression unit comprising:a header generation unit configured to identify common base informationfor compressing a first data set according to a first fixed-lengthcompression algorithm, the first data set comprising all or a portion ofthe two-dimensional block of first values; and a body generation unitconfigured to: identify a fixed-length parameter for each first value inthe first data set according to the first fixed-length compressionalgorithm; and form a compressed block for the block of image data basedon the common base information and the fixed-length parameters.

A third aspect provides a compression unit configured to perform themethod of the first aspect.

The compression units, decompression units and compression/decompressionunits described herein may be embodied in hardware on an integratedcircuit. There may be provided a method of manufacturing, at anintegrated circuit manufacturing system, a compression unit, adecompression unit or a compression/decompression unit described herein.There may be provided an integrated circuit definition dataset that,when processed in an integrated circuit manufacturing system, configuresthe system to manufacture the compression unit, the decompression unitor the compression/decompression unit. There may be provided anon-transitory computer readable storage medium having stored thereon acomputer readable description of a compression unit, a decompressionunit or a compression/decompression unit that, when processed in anintegrated circuit manufacturing system, causes the integrated circuitmanufacturing system to manufacture an integrated circuit embodying acompression unit, a decompression unit or a compression/decompressionunit.

There may be provided an integrated circuit manufacturing systemcomprising: a non-transitory computer readable storage medium havingstored thereon a computer readable description of a compression unit, adecompression unit or a compression/decompression unit described herein;a layout processing system configured to process the computer readabledescription so as to generate a circuit layout description of anintegrated circuit embodying the compression unit, the decompressionunit or the compression/decompression unit; and an integrated circuitgeneration system configured to manufacture the compression unit,decompression unit, or the compression/decompression unit according tothe circuit layout description.

There may be provided computer program code for performing a method asdescribed herein. There may be provided non-transitory computer readablestorage medium having stored thereon computer readable instructionsthat, when executed at a computer system, cause the computer system toperform the methods as described herein.

The above features may be combined as appropriate, as would be apparentto a skilled person, and may be combined with any of the aspects of theexamples described herein.

BRIEF DESCRIPTION OF THE DRAWINGS

Examples will now be described in detail with reference to theaccompanying drawings in which:

FIG. 1 is a block diagram of an example graphics rendering system;

FIG. 2 is a flow diagram of an example method for compressing a block ofimage data;

FIG. 3 is a schematic diagram illustrating an example block of imagedata comprising data for multiple colour channels;

FIG. 4 is a schematic diagram illustrating a channel block divided intoa plurality of sub-blocks;

FIG. 5 is a graph illustrating the percentage of colour channels with acommon colour value for an example benchmark;

FIG. 6 is a schematic diagram illustrating a set of colour valuesfalling into two clusters;

FIG. 7 is a schematic diagram illustrating modulo arithmetic;

FIG. 8 is a graph illustrating the number of delta bits used to compress8×8 channel blocks/sub-blocks using the origin and delta compressionalgorithm for an example benchmark test;

FIG. 9 is a graph illustrating the number of delta bits used to compress16×16 channel blocks/sub-blocks using the origin and delta compressionalgorithm for an example benchmark test;

FIG. 10 is a graph illustrating the number of delta bits used tocompress 32×32 channel blocks/sub-blocks using the origin and deltacompression algorithm for an example benchmark test;

FIG. 11 is a schematic diagram illustrating a second set of colourvalues falling into two clusters;

FIG. 12 is a schematic diagram illustrating compressing an examplechannel sub-block using the look-up table compression algorithm;

FIG. 13 is a graph illustrating the distribution of channel colourvalues for unique channel blocks for a plurality of applications;

FIG. 14 is a graph illustrating the distribution of compressionalgorithms for a plurality of applications when the compressionalgorithms comprise the origin and delta compression algorithm, thepredetermined colour compression algorithm and the look-up tablecompression algorithm;

FIG. 15 is a schematic diagram of a first example compressed blockformat when the channel blocks are not divided into sub-blocks prior tocompression;

FIG. 16 is a schematic diagram of a second example compressed blockformat when the channel blocks are not divided into sub-blocks prior tocompression;

FIG. 17 is a schematic diagram of an example compressed block formatwhen the channel blocks are divided into sub-blocks prior tocompression;

FIG. 18 is a schematic diagram of a block of image data wherein eachchannel block is divided into a plurality of sub-blocks;

FIG. 19 is a flow diagram of a first example method for selecting afixed-length compression algorithm for compressing a channelblock/sub-block;

FIG. 20 is a flow diagram of a second example method for selecting afixed-length compression algorithm for compressing a channelblock/sub-block;

FIG. 21 is a schematic diagram of a channel block that is divided intomultiple levels of blocks;

FIG. 22 is a flow diagram of an example method for selecting the blocksof a channel block to compress;

FIG. 23 is a schematic diagram of an example header for a compressedblock when a hierarchical compression scheme is used;

FIG. 24 is a block diagram of an example compression unit forcompressing a block of image data;

FIG. 25 is a block diagram of an example decompression unit fordecompressing a compressed block of image data that was compressed usingthe method of FIG. 2;

FIG. 26 is a flow diagram of an example method of decompressing a blockof image data that was compressed using the method of FIG. 2;

FIG. 27 is a graph illustrating the size of the compressed blocks ofimage data compared to the size of the uncompressed blocks of image datafor a variety of compression schemes for a benchmark test;

FIG. 28 is a graph illustrating the percentage of channel blocks with acommon colour value for a plurality of different benchmark tests;

FIG. 29 is a graph illustrating the size of the compressed blocks ofimage data compared to the size of the uncompressed blocks of image datafor a variety of compression schemes for a plurality of differentbenchmark tests;

FIG. 30 is a block diagram of an example computer system in which thecompression units, decompression units and/or compression/decompressionunits described herein may be implemented; and

FIG. 31 is a block diagram of an example integrated circuitmanufacturing system for generating an integrated circuit embodying acompression unit, a decompression unit or a compression/decompressionunit described herein.

The accompanying drawings illustrate various examples. The skilledperson will appreciate that the illustrated element boundaries (e.g.,boxes, groups of boxes, or other shapes) in the drawings represent oneexample of the boundaries. It may be that in some examples, one elementmay be designed as multiple elements or that multiple elements may bedesigned as one element. Common reference numerals are used throughoutthe figures, where appropriate, to indicate similar features.

DETAILED DESCRIPTION

The following description is presented by way of example to enable aperson skilled in the art to make and use the invention. The presentinvention is not limited to the embodiments described herein and variousmodifications to the disclosed embodiments will be apparent to thoseskilled in the art. Embodiments are described by way of example only.

As described above, compressing image data on a block basis in a mannerthat requires decompression of the whole block to access individualvalues makes it difficult for the logic, such as the rendering logic,that randomly accesses the image data to access the data efficiently.What is therefore needed is a lossless method of compressing image datawhich allows the compressed data to be randomly accessed (i.e.individual values in the compressed block can be accessed without havingto decompress the whole block).

Accordingly, described herein are methods and systems for compressing ablock of image data so that the individual values of the block can bedecompressed without having to decompress the whole block. Specifically,described herein are methods and systems for compressing a block ofimage data that comprises a plurality of image element values (e.g.colour values) that are divisible into at least a first value and asecond value (e.g. a first channel colour value and a second channelcolour value) such that the image data comprises at least atwo-dimensional block of first values (e.g. a two-dimensional block ofcolour values for the first colour channel) and a two-dimensional blockof second values (e.g. a two-dimensional block of colour values for thesecond colour channel). The term ‘image element value’ is used herein torefer to the unit of the particular image data. Accordingly the imageelement value is dependent on the type of image data. For example, forcolour data the image element value is a pixel value or colour value(e.g. which may be defined by a set of channel colour values); for depthdata the image element value is a depth value; for surface normal datathe image element value is a surface normal direction (e.g. which may bedefined by a set of values representing a unit vector or one or moreangles); and for texture data the image element value is a texel value(e.g. which may be defined by a colour value or a set of colour values).

In the methods and systems described herein each two-dimensional blockof values is compressed separately using one or more fixed-lengthcompression algorithms. In particular, in the methods and systemsdescribed herein one or more of the two-dimensional blocks of values iscompressed by compressing all or a portion of the two-dimensional blockof values using a fixed-length compression algorithm wherein values inthe two-dimensional block (or a portion thereof) are represented bycommon base information and a fixed-length parameter for each value inthe block (or a portion thereof) that is zero, one or more than one bitsin length. A compressed block for the image data is then formed from thecommon base information and the fixed-length parameters. By compressinga two-dimensional block of values (or a portion thereof) using afixed-length compression algorithm all of the values in thattwo-dimensional block (or the portion thereof) are represented using thesame number of bits thus the portion of the compressed data that relatesto a particular value can be easily identified.

In some example methods and systems described herein the image data isdivided into one or more blocks (e.g. 32×32 blocks of image elements,16×16 blocks of image elements or 8×8 blocks of image elements) and thevalues in any two-dimensional block of values (e.g. each colour channel)in a block are represented by a fixed number of bits. For example, ifthe image data is colour data that comprises colour values for fourchannels numbered 0 to 3 and the image data is divided into 8×8 blocksof pixels then each channel 0 colour value in a particular 8×8 block ofpixels will be represented by the same number of bits b₀, each channel 1colour value in that 8×8 block of pixels will be represented by the samenumber of bits b₁, each channel 2 colour value in that 8×8 block ofpixels will be represented by the same number of bits b₂, and eachchannel 3 colour value in that 8×8 block of pixels will be representedby the same number of bits b₃. Thus if all the bits that relate to thesame pixel are packed together to form a pixel data unit then each pixeldata unit will have b₀+b₁+b₂+b₃ bits. If the pixel data units for ablock are then packed together in pixel order to form a block data unitthen the start of the pixel data unit for the i^(th) pixel, wherein thefirst pixel is numbered 0, is at the i*(b₀+b₁+b₂+b₃) bit from the startof the block data unit.

The particular bits of the pixel data unit that correspond to aparticular colour value can then be determined from b₀, b₁, b₂, b₃ andthe ordering of the channels in the pixel data unit. For example if thebits of each channel are packed together in the pixel data unit inchannel order then the bits corresponding to the colour value forchannel 0 are the first b₀ bits in the pixel data unit; the bitscorresponding to the colour value for channel 1 are the b₁ bits startingfrom bit b₀; the bits corresponding to the colour value for channel 2are the b₂ bits starting from bit b₀+b₁; and the bits corresponding tothe colour value for channel 3 are the last b₃ bits starting fromb₀+b₁+b₂. Accordingly the compressed blocks generated by the methods andsystems described herein are randomly accessible.

In the example compression and decompression methods and systemsdescribed below the blocks of image data are of blocks of colour values,e.g. pixel colour values, and each two-dimensional block of valuesrelates to one of the colour channels of the pixel colour. For example,where the pixel colour values represent four channel RGBA data, therewill be a two-dimensional block of values corresponding to each of the R(red), G (green), B (blue), and A (alpha) colour channels. However, theuse of pixel colour values is for example only, and it should beunderstood that the compression and decompression methods and systemsmay operate on any type of image data, e.g. depth data, lighting data,or surface normal data.

Furthermore, although in the examples below each image element value(e.g. pixel value) is comprised of a plurality of distinct values (e.g.each pixel value comprises a first channel colour value, a secondchannel colour value etc.) and the image data is divided intotwo-dimensional blocks of values on a per distinct value basis (e.g. onetwo-dimensional block of values comprises the first channel colourvalues, another two-dimensional block of values comprises the secondchannel colour values etc.) in other examples the image data may bedivided into two-dimensional blocks of values in another manner. In somecases, each image element value may be a single distinct value (e.g.depth value) which may be divided into smaller chunks or portions whichare used to form the two-dimensional blocks of values. For example, ifthe image element value is a multi-byte value the first two-dimensionalblock of values may comprise the first byte of each image element value(e.g. depth value), and a second two-dimensional block of values maycomprise the second byte of each image element value (e.g. depth value).In other cases, each image element value may comprise a plurality ofdistinct values (e.g. a colour value for each of a plurality of colourchannels), but the image data may not be divided into two-dimensionalblocks of values on a per distinct value basis. For example, if eachimage element value comprises a first 10-bit colour channel value, asecond 10-bit colour channel value, a third 10-bit colour channel valueand a 2-bit colour channel value, instead of dividing the image datainto two-dimensional blocks of values on a per channel basis the imagedata may be divided into two-dimensional blocks of values on a per-bytebasis. In particular, a first two-dimensional block of values maycomprise the first byte of each image element value and a secondtwo-dimensional block of values may comprise the second byte of eachimage element value. In another example, the top eight-bits of each10-bit colour channel value may form a block and a final block may beformed of the two lowest bits of each channel. For example, a firsttwo-dimensional block of values may comprise the first 8-bits of thefirst colour channel value, a second two-dimensional block of values maycomprise the first 8-bits of the second colour channel value, a thirdtwo-dimensional block of values may comprise the first 8-bits of thethird colour channel value, and a fourth two-dimensional block of valuesmay comprise the last two bits of each colour channel. It will beevident to a person of skill in the art that these are examples only andthat the image element values may be divided into multiple values inanother manner to form the two-dimensional blocks of values.

In some cases, each image element value may be divided into a pluralityof multi-bit values. In other words, each image element value may bedivided into a plurality of sub-values wherein each sub-value comprises,or is formed by, at least two bits. For example, where each imageelement value is divided into a first value and a second value such thatthe block of image data comprises a two-dimensional block of firstvalues and a two-dimensional block of second values, each first valuemay be a multi-bit value (i.e. a value comprising, or formed by, morethan one bit) and each second value may be a multi-bit value (i.e. avalue comprising, or formed by, more than one bit). In some cases, theimage element values may be divided into eight-bit (i.e. byte) values.For example, as described above, each image element value may be dividedinto sub-values along byte lines (e.g. the first eight-bits of an imageelement value may form the first value, the second eight-bits of anelement value may form the second value etc.) Dividing the image elementvalues into multi-bit values, as opposed to single-bit values, may allowthe compression methods and systems described herein to more efficientlycompress a two-dimensional block of values (e.g. first values (e.g.first colour channel values) or second values (e.g. second colourchannel values)), and thus more efficiently compress a block of imagedata comprising that two-dimensional block of values, as it reduces thenumber of two-dimensional blocks of values (which reduces the headeroverhead) and allows some of the more complicated fixed-lengthcompression algorithms described below to be used to compress thetwo-dimensional block of values.

Reference is now made to FIG. 2 which illustrates an example method 200for compressing a block of image data. The method 200 begins at step 202where a block of image data to be compressed is received. In thisexample the block of image data is a block of colour values or pixelvalues.

As is known to those of skill in the art, data defining a digital image(e.g. a frame) comprises a set of one or more colour values for eachpixel that may be used to determine the colour of that pixel. The set ofcolour values for a pixel may comprise a colour value for each colourchannel. The number of channels is typically based on the format of theimage. For example, if the image is in RGB format there are three colourchannels—red, green and blue—and there is a red colour value, a greencolour value and a blue colour value for each pixel. Similarly if theimage is in RGBA format there are four channels—red, green, blue andopacity (or alpha)—and there is a red colour value, a green colourvalue, a blue colour value and an opacity (or alpha) value for eachpixel. The colour values for each channel can be understood as forming atwo-dimensional array or block.

For example, FIG. 3 illustrates example image data 300 for a 32×32 pixelRGBA digital image. The image data 300 comprises a two-dimensional blockof 8-bit colour values for each channel which may be referred to hereinas a channel block. Specifically, the image data 300 comprises a 32×32block 302 of 8-bit colour values for channel 0 (i.e. the red channel); a32×32 block 304 of 8-bit colour values for channel 1 (i.e. the greenchannel); a 32×32 block 306 of 8-bit colour values for channel 2 (i.e.the blue channel); and a 32×32 block 308 of 8-bit colour values forchannel 3 (i.e. the opacity channel). The colour at each pixel (whichmay be referred to herein as the pixel colour value) is determined fromthe different channel colour values associated with that pixel (i.e. thechannel 0 colour value, the channel 1 colour value, the channel 2 colourvalue, and the channel 3 colour value associated with that pixel).

A block of image data is the portion of the image data corresponding toa two-dimensional block of pixels in the image. Accordingly a block ofimage data comprises a two-dimensional block of colour values for eachcolour channel. The block of image data may be any suitable size. Forexample, the block of image data may comprise colour values for a 32×32block of pixels, a 16×16 block of pixels or an 8×8 block of pixels.Where the compression is used to compress frame buffer data in agraphics processing system that implements tile-based rendering, theblock of image data may correspond to a tile (e.g. a 32×32 block ofpixels corresponding to a 32×32 pixel tile), to a set of tiles (e.g. a32×32 block of pixels corresponding to four 16×16 pixel tiles), or to aportion of a tile (e.g. a 16×16 block of pixels corresponding to aquarter of a 32×32 pixel tile). Once a block of image data has beenreceived the method 200 proceeds to step 204.

At step 204, the block of image data is divided into channel blocks. Forexample, if the block of image data 300 shown in FIG. 3 is received instep 202 the block of image data 300 is divided into the four channelblocks 302, 304, 306 and 308 shown in FIG. 3. Once the block of imagedata has been divided into channel blocks, the method 200 proceeds tostep 206 where the channel blocks are compressed separately. With theexception of areas of constant colour, e.g. background or clear colour,for which specific compression techniques will be described below,rendered images typically do not contain many pixels which have the samepixel colour value (the colour determined from the colour values foreach channel). It is possible, however, for many pixels (particularlythose in close proximity to each other) to have one or more similarchannel (e.g. red, green, blue or opacity) colour values. Accordingly,compressing a block of image data on a per channel basis may allow moreefficient compression of image data as those parts of the image datathat are more likely to be similar are compressed together.

At step 206, one or more of the channel blocks is compressed bycompressing one or more data sets of the channel block using afixed-length compression algorithm to generate one or more compressedchannel blocks. In some cases, an entire channel block may be compressedso that the data set that is compressed is the entire channel block. Inother cases, the channel block may be sub-divided into channelsub-blocks so that the data set(s) that are compressed comprise one ormore channel sub-blocks. The term channel sub-block is used herein tomean a portion of a channel block that is smaller than the channel blockin at least one dimension. For example, as shown in FIG. 4, if thechannel block 402 is a 32×32 block of colour values then the channelblock 402 may be sub-divided into sixteen 8×8 sub-blocks 404 of colourvalues and one or more of the 8×8 sub-blocks 404 may be compressed usinga fixed-length compression algorithm.

As is known to those of skill in the art, a fixed-length compressionalgorithm is a compression algorithm in which each of the items (e.g.colour values) in the set of items (e.g. channel block/sub-block ofcolour values) being compressed is represented by the same number ofbits in the compressed format. Accordingly, by using a fixed-lengthcompression algorithm to compress a channel block/sub-block each colourvalue in that block/sub-block is represented in the compressed block bythe same number of bits which allows the bits relating to any particularcolour value in the channel block/sub-block to be easily identified.Thus, using a fixed-length compression algorithm allows the compressedblock to be randomly accessible.

The fixed-length compression algorithm is configured to compress a blockor sub-block of values by (i) identifying common base information forthe block; and (ii) identifying a fixed-length parameter for each valuesuch that the original value can be obtained from the common baseinformation and the fixed-length parameter. For example, onefixed-length compression algorithm may identify a common origin valuefor the block or sub-block and identify a fixed-length delta value foreach value in the block or sub-block that represents the differencebetween the common origin value and the value. Example fixed-lengthcompression algorithms which may be used to compress a channelblock/sub-block are described below.

When an entire channel block is compressed as a whole, only a single setof common base information is generated for the channel block and afixed-length parameter is generated for each colour value in the channelblock. For example, if the channel block is a 32×32 block of colourvalues then only a single set of common base information is generatedfor the channel block and a fixed-length parameter may be generated foreach colour value in the channel block. In contrast, when the channelblock is divided into a plurality of sub-blocks and one or more of thechannel sub-blocks are compressed, a set of common base information isgenerated for each sub-block that is compressed. For example, a 32×32channel block may be divided into four 16×16 channel sub-blocks and iftwo of these sub-blocks are compressed then common base information andfixed-length parameters are generated for each of the two compressedsub-blocks.

Where a channel block is divided into channel sub-blocks and multiplechannel sub-blocks are compressed, the same fixed-length compressionalgorithm does not have to be used to compress each sub-block. Forexample, a first channel sub-block may be compressed using a firstfixed-length compression algorithm and a second channel sub-block forthe same channel may be compressed using a second, different,fixed-length compression algorithm. As described in more detail below,this allows each channel sub-block to be compressed by the most suitablefixed-length compression algorithm for that channel sub-block.

Similarly, where all or a portion of multiple channel blocks arecompressed the same compression algorithm(s) do not have to be used forall the channel blocks. For example, a first sub-block of a firstchannel block may be compressed using a first fixed-length compressionalgorithm whereas a first sub-block of a second channel block may becompressed using a second, different fixed-length compression algorithm.As described in more detail below, since different channels havedifferent characteristics this allows each channel to be compressed bythe most suitable fixed-length compression algorithm(s) for thatchannel.

Once one or more of the channel blocks have been compressed the method200 proceeds to step 208.

At step 208, a compressed block of image data is generated from thecompressed channel blocks generated in step 206. In some cases, acompressed block may comprise a header and a body. The header comprisesinformation that identifies the size or length of the fixed-lengthparameter used for each compressed channel block/sub-block and thecommon base information for each compressed channel block/sub-block. Forexample, the header may comprise, for each compressed channelblock/sub-block: (i) a length or size field (which may also be referredto herein as the format field) that indicates the length of thefixed-length parameter for that compressed channel block/sub-block; and(ii) a common base information field that comprises the common baseinformation for that compressed channel block/sub-block. The bodycomprises the fixed-length parameters for each compressed channelblock/sub-block and the original colour values for any uncompressedchannel block/sub-block.

Where a channel block/sub-block can be compressed using one of aplurality of fixed-length compression algorithms the header may alsocomprise, for each compressed channel block/sub-block, informationindicating the fixed-length compression algorithm that was used tocompress that channel block/sub-block. In some cases, there may be aseparate compression algorithm field for each compressed channelblock/sub-block which indicates the compression algorithm that was usedto compress that channel block/sub-block. However, in other cases theinformation indicating the fixed-length compression algorithm that wasused to compress a channel block/sub-block may be incorporated intoanother field. For example, in some cases the length or size field maybe used to indicate which compression algorithm was used (e.g. thelength or size field may be set to a certain value to indicate a firstfixed-length compression algorithm was used and set to another value toindicated a second, different, fixed-length compression algorithm wasused).

The header may also comprise information indicating which, if any,channel blocks/sub-blocks were not compressed. In some cases, there maybe a separate compressed/uncompressed field for each channelblock/sub-block that indicates whether that channel block/sub-block wascompressed or not. However, in other cases the information indicatingthat a channel block/sub-block was not compressed may be incorporatedinto another field. For example, in some cases the length or size fieldor the compression algorithm field may be used to indicate that achannel block/sub-block was not compressed. Example formats for acompressed block are described below with reference to FIGS. 15 to 17.

As described above, the body comprises the fixed-length parameters foreach compressed channel block/sub-block and the original colour valuesfor any uncompressed channel block/sub-block. The fixed-lengthparameters and/or original colour values may be stored in the body inany manner that allows the fixed-length parameters and/or originalcolour values to be randomly accessible. In some cases, as described inmore detail below, the fixed-length parameters and/or original colourvalues for each pixel may be stored together in a pixel data unit. Forexample, where the image data comprises colour values for four channelsnumbered 0 to 3, each pixel data unit may comprise the fixed-lengthparameter/original colour value for channel 0, the fixed-lengthparameter/original colour value for channel 1, the fixed-lengthparameter/original colour value for channel 2, and the fixed-lengthparameter/original colour value for channel 3. In these cases, the pixeldata units may be stored in in the body in any order which allows thepixel data units (and thus the fixed-length parameters/original colourvalues thereof) to be randomly accessible. In some cases, where thechannel blocks are divided into sub-blocks prior to compression, thepixel data units for each sub-block may be stored together. For example,if the channel blocks are divided into 8×8 sub-blocks then the pixeldata units for each 8×8 image data sub-block may be stored together.

Example Fixed-Length Compression Algorithms

Example fixed-length compression algorithms which may be used tocompress a channel block/sub-block in step 206 of the method 200 of FIG.2 will now be described.

A first example fixed-length compression algorithm which may be used tocompress a channel block/sub-block in step 206 of the method 200 of FIG.2 is referred to herein as the common value compression algorithm. Inthis compression algorithm if all the colours values in the channelblock/sub-block are the same then all the colour values of theblock/sub-block can be efficiently represented by a single copy of thatcolour value. While rendered images typically do not contain many pixelswhich have the same pixel colour value (the colour determined from thecolour values for each channel), it is possible for many pixels(particularly those in close proximity to each other) to share one ormore common channel (e.g. red, green, blue or opacity) colour values.For example, where the image data is in RGBA format it is very commonfor many of the pixels to have the same opacity (or alpha) value.Accordingly, in the common value compression algorithm the common baseinformation is the common colour value and the fixed-length parametershave zero bit length (i.e. no fixed-length parameters are stored).

As is known to those of skill in the art, there are a set of standardbenchmark tests which are used to measure the graphics performance ofdevices. The benchmark tests provide the device with game-like contentand the performance of the device in response thereto is measured andused to benchmark the device's graphics performance. FIG. 5 illustratesthe percentage of blocks in the Manhattan 3.0 benchmark test that have acommon channel colour value for a variety of block sizes. Specifically,FIG. 5 illustrates the number of 8×8 blocks, 16×16 blocks and 32×32blocks which have a common colour value for each of the R, G, B, and Achannels. It can be seen from FIG. 5 that around 20% of the 8×8 blockshad a common colour value for channel 0 (red channel) and channel 1(green channel); 30% of the 8×8 blocks had a common colour value forchannel 2 (blue channel); and 80% of the 8×8 blocks had a common colourvalue for channel 3 (opacity channel). It can be seen from FIG. 5 thatas the block size increases (e.g. to 16×16 and 32×32) the number ofblocks which had a common channel colour value decreased. However, evenat a block size of 32×32 60% of the blocks had a common colour value forchannel 3 (opacity channel). Accordingly, significant bandwidth savingscan be achieved by identifying those blocks that have a common channelcolour value and representing all the colour values of that block with asingle copy of that colour value.

A second example fixed-length compression algorithm which may be used tocompress a channel block/sub-block in step 206 of the method 200 of FIG.2 is referred to herein as the origin and delta compression algorithm.In this compression algorithm each colour value is represented by acommon origin value and an individual delta value with a fixed number ofbits. Each delta value indicates the difference between the colour valueand the origin value. The number of delta bits is based on the range ofcolour values in the block. Specifically the number of delta bits torepresent a range k is [log₂(k+1)]. Table 1 illustrates the number ofdelta bits required to represent ranges up to 255. It can be seen thatthe smaller the range of colour values in a block/sub-block, the fewerbits can be used to represent those colour values.

TABLE 1 Range Delta Bits [0, 1]  1 [0, 3]  2 [0, 7]  3 [0, 15] 4 [0, 31]5 [0, 63] 6  [0, 127] 7  [0, 255] 8

In some cases, the origin and delta compression algorithm may only bedeemed a suitable compression algorithm if the number of bits used torepresent the range is less than the number of bits to represent theoriginal colour values. For example, if the original colour values are8-bits then the origin and delta compression algorithm may only bedeemed to be suitable if the range can be represented with 7 or fewerbits.

A compressed colour value can be easily decompressed by adding the deltavalue for that colour value to the origin value.

In some cases, the minimum colour value or the maximum colour value inthe block/sub-block is used as the origin. This allows all of the deltavalues to be positive or all the delta values to be negative, which cansimplify the decompression calculations. In other cases, an intermediatevalue in the range, such as the mean or the midpoint of the range ofvalues may be used as the origin and one bit of the delta value may beused as a sign bit.

In yet other cases, it may be more efficient to determine the deltavalue as the difference between the colour value and the origin valuemodulo 2^(x) wherein x is the number of bits used to represent thecolour values. This may allow a block/sub-block of colour values thatare clustered into ranges that are at the two ends of the colour valuerange to be represented more efficiently. For example, if each colourvalue is 8-bits which allows a minimum colour value of 0 and maximumcolour value of 255; and, as shown in FIG. 6, the colour values for achannel block/sub-block fall into two clusters 602 and 604 wherein theminimum value of the first cluster 602 is 0 and the maximum value of thefirst cluster 602 is 20, and the minimum value of the second cluster 604is 235 and the maximum value of the second cluster 604 is 255 then therange 606 of values in the block/sub-block is 255 thus 8 delta bits arerequired to represent the range.

If, however, the 8-bit range [0, 255] is considered a circle when usingmodulo arithmetic (i.e. modulo 2^(x)=2⁸=256) as shown in FIG. 7, thenthere are two paths that can be taken to get from one number in therange to another number in the range. Specifically, the clockwise path702 may be taken where a value is added to the first number; or thecounter-clockwise path 704 may be taken where a value is subtracted fromthe first number. For example, to get from 255 to 0, either 1 can beadded to 255 (i.e. (255+1) mod 256=0) or 255 can be subtracted from 255(i.e. (255−255) mod 256=0).

The range for a set of values can then be represented as any path on thecircle that encompasses all of the numbers in the set. For example, therange for the example set of values shown in FIG. 6 which fall into twoclusters—a first cluster 602 with a min of 0 and a max of 20, and asecond cluster 604 with a min of 235 and a max of 255—can be representedas a path from 0 to 255 which results in a range of 255 which wouldrequire 8 delta bits; or the range (shown at 608 in FIG. 6) can berepresented as the path from 235 to 20 which results in a range of 41which would require only 6 delta bits. Thus this example set of valuescan be represented much more efficiently if the origin is set to 235 and6 delta bits are used to represent the difference between the colourvalue and the origin modulo 256.

It will be evident to a person of skill in the art, that these areexamples only and other suitable values may be used as the origin value.

Accordingly, in the origin and delta compression algorithm the commonbase information is the origin value and the fixed-length parameter foreach colour value is the delta value.

Reference is now made to FIGS. 8 to 10 which show the percentage ofchannel blocks that were represented with each number of delta bits on aper channel basis when the origin and delta compression algorithm wasused to compress RGBA formatted image data with 8-bit colour values inthe Manhattan 3.0 benchmark test. Specifically, FIG. 8 illustrates thepercentage of 8×8 channel blocks that were represented using 0-8 deltabits;

FIG. 9 illustrates the percentage of 16×16 channel blocks that wererepresented using 0-8 delta bits; and FIG. 10 illustrates the percentageof 32×32 channel blocks that were represented using 0-8 delta bits. Itcan be seen from FIG. 8 that overall roughly 80% of the 8×8 channelblocks can be compressed using the origin and delta compressionalgorithm (and the common value algorithm when all the colour values ina channel block are the same).

A third example fixed-length compression algorithm which may be used tocompress a channel block/sub-block in step 206 of the method 200 of FIG.2 is a variant of the origin and delta compression algorithm and isreferred to herein as the multiple origin and delta compressionalgorithm. Instead of there being a single origin, there are multipleorigins and each colour value is represented by the common origins, anindividual index which identifies one of the common origins and a deltavalue that indicates the difference between the colour value and theidentified origin. The multiple origin and delta compression algorithmmay be suitable where the colour values in the channel block/sub-blockare clustered into two or more groups such that the range of colourvalues within the channel block/sub-block is large, but the range withineach cluster is small. Accordingly, in the multiple origin and deltacompression algorithm the common base information is the plurality oforigin values and the fixed-length parameter for each colour value isthe index identifying one of the origins and the delta value.

For example, FIG. 11 illustrates an example where colour values can bebetween 0 and 255 and the colour values in a channel block fall withintwo clusters 1102, 1104—a first cluster 1102 wherein the colour valuesare between 25 and 50 and a second cluster 1104 wherein the colourvalues are between 215 and 240. The range of all the colour values inthe channel block is 240−25=115 which, according to Table 1, wouldrequire 7 delta bits. Alternatively, using modulo 256 arithmetic asdescribed above, the range of all the colour values in the channel blockis (50-215) mod 256=91, which, although smaller than 115, still requires7 delta bits according to Table 1. However, the range for each clusteris only 25, which, according to Table 1, would require only 5 deltabits. Thus if there were two origin values, one for each cluster 1102,1104, and the delta for each colour value is calculated from one of theorigin values each colour value can be represented by a 5 bit deltavalue. For example, 25 and 215 may be stored as origin values 0 and 1respectively, then for each colour value falling in the first cluster1102 an index of 0 is stored along with a 5-bit delta value indicatingthe difference between the colour value and the first origin value (i.e.25 in this example); and for each colour value falling in the secondcluster 1104 an index of 1 is stored along with a 5-bit delta valueindicating the difference between the colour value and the second originvalue (i.e. 215 in this example).

A fourth example fixed-length compression algorithm which may be used tocompress a channel block/sub-block in step 206 of the method 200 of FIG.2 is referred to herein as the look-up table compression algorithm. Inthis compression algorithm each unique colour value in the channelsub-block is stored in a look-up table and then a fixed-length indexinto the table is generated for each colour value in theblock/sub-block. This method is suitable where there are only a smallnumber of different colour values which may occur, for example, in blackand white images.

For example, as shown in FIG. 12, if a channel sub-block 1202 comprisesonly three colour values—0, 128 and 255 then according to the look-uptable compression algorithm these three values would be placed in alook-up table 1204 and each colour value in the block would berepresented by an index into the look-up table as shown at 1206.Specifically, if, as shown in FIG. 12 the colour value 0 is stored atindex 0 of the look-up table 1204, the colour value 128 is stored atindex 1 of the look-up table 1204, and the colour value 255 is stored atindex 2 of the look-up table 1204, then each zero is represented by anindex of 0, each 128 is represented by an index of 1, and each 255 isrepresented by an index of 2.

Accordingly, in the look-up table compression algorithm the common baseinformation is the look-up table of unique colour values and thefixed-length parameter for each colour value is the index to the look-uptable.

A fifth example fixed-length compression algorithm which may be used tocompress a channel block/sub-block in step 206 of the method 200 of FIG.2 is referred to herein as the predetermined colour compressionalgorithm. In this compression algorithm there are a small number (e.g.one to four) of predetermined colour values and if all the colour valuesin the block are the same and match one of the predetermined colourvalues then instead of storing the colour value, information (e.g. anindex or the like) identifying one of the predetermined colours isstored.

In some cases, there may only be a single predetermined colour value. Inthese cases, identifying that the predetermined colour compressionalgorithm was used also identifies the predetermined colour. In otherwords, in these cases the predetermined colour value compressionalgorithm may be used to identify one particular colour value.

In other cases, there may be a plurality of predetermined colour values(which may be stored in memory). In these cases, in addition toidentifying that the predetermined colour compression algorithm was usedto compress a channel block/sub-block, information is stored whichidentifies one of the plurality of predetermined colour values. Thisidentification of the particular colour value of the plurality ofpredetermined colour values may take any suitable form. For example, insome cases an index may be stored which identifies the particular colourvalue.

In some cases, the predetermined colour compression algorithm may beused to compress an entire block of image data (e.g. all channels of ablock). For example, in some cases, applications may set each pixel to aclear colour value to clear the frame buffer before any draw calls. Thespecific clear colour value is generally a specific combination of thechannel colour values. For example, the clear colour value may be00FFFFFF (hexadecimal) for 8-bit per channel ARGB format where the firsttwo hexadecimal values correspond to channel 0, the next two hexadecimalvalues correspond to channel 1, the next two hexadecimal valuescorrespond to channel 2, and the final two hexadecimal values correspondto channel 3. The clear colour value is generally stored in memory andthus it is not necessary to store the clear colour value in thecompressed block. Accordingly, in these cases the predetermined colourvalue compression algorithm can be used to indicate that every pixel inthe block has the clear colour value. It will be evident to a person ofskill in the art that this is an example only, and that thepredetermined colour compression algorithm may be used to identifyanother pixel colour value.

In another example, there may, also or alternatively, be a plurality ofpredetermined special pixel colour values which are frequently used. Forexample, in some cases, where an 8-bit per channel ARGB format is used,00000000 (hexadecimal) and FF000000 (hexadecimal) may be defined asspecial pixel colour values as they are commonly used. In these cases,if it is determined that all of the pixels in a block have the samecolour value and it is one of the predetermined colour values (or theclear colour value) then the predetermined colour compression algorithmmay be used to compress this block by storing information (e.g. anindex) that identifies one of the predetermined pixel colour values.This allows blocks wherein each pixel of the block has the same specialpixel colour value to be compressed very efficiently.

In some cases, in addition or alternatively to using the predeterminedcolour compression algorithm to compress a whole block of image data(e.g. all channels of a block) (which may be referred to herein as thepredetermined pixel colour compression algorithm), the predeterminedcolour compression algorithm may be used to compress individual channelblocks/sub-blocks of a block of image data (which may be referred toherein as the predetermined channel colour compression algorithm).Specifically, instead of there being one or more predetermined pixelcolour values (e.g. a 32-bit pixel colour value) there are one or morepredetermined channel colour values (e.g. an 8-bit channel colour value)and if all the colour values in a channel block/sub-block are the sameand match one of the predetermined channel colour values then thepredetermined colour compression algorithm may be used to compress thechannel block/sub-block. This may allow more blocks to be efficientlycompressed compared to compressing at the pixel level.

The predetermined channel colour compression algorithm works mosteffectively when the predetermined channel colour values are the mostcommon channel colour values in the unique channel blocks (i.e. thechannel blocks in which all the colour values are the same). In somecases, the predetermined channel colour values may be fixed for thegraphics processing system (i.e. the same predetermined channel colourvalues are used for any and all applications running on the graphicsprocessing system). In other cases, the predetermined colour channelcolours may be application specific. For example, the graphicsprocessing system may comprise memory (e.g. a register) which can beused to dynamically identify the predetermined channel colour values tobe used for a particular application. In some cases, a portion (e.g.two) of the predetermined channel colour values may be fixed and anotherportion (e.g. two) of the predetermined channel colour values may beprogrammable or dynamically selectable.

For example, FIG. 13 shows the distribution of colour values for the 8×8channel blocks with a unique colour value (i.e. all the colour values inthe 8×8 block are the same) for a plurality of different applications.It can be seen in FIG. 13 that a significant portion of the unique 8×8channel blocks have colour values of 00 (hexadecimal) or FF(hexadecimal). Accordingly, the predetermined channel colour compressionalgorithm may be used to efficiently compress a significant number ofunique colour channel blocks if the predetermined channel colour valuesare set to 00 (hexadecimal) and FF (hexadecimal). Also, since pixelcolour values of 00000000 (hexadecimal), FFFFFFFF (hexadecimal),00FFFFFF (hexadecimal) and FF000000 (hexadecimal) are very common thiswill also cover off the common pixel colour values.

However, it can be seen that the next highest colour values for theunique channel blocks is application specific. For example, FD(hexadecimal), F1 (hexadecimal) and EE (hexadecimal) are commonly usedchannel colour values in the ‘Angry Birds’ application but not in otherapplications. Similarly, A6 (hexadecimal) and 96 (hexadecimal) arecommonly used channel colour values in the ‘Leanback’ application, butnot in other applications. Accordingly, the number of blocks that can becompressed using this method may be increased if a number (e.g. two) ofthe predetermined channel colour values were programmable. For example,in some cases there may be four predetermined channel colour values—twoof the predetermined colour values may be fixed at 00 (hexadecimal) andFF (hexadecimal)—and two of the predetermined colour values may beprogrammable (e.g. via register settings). For example, the twoprogrammable predetermined colour values may be set to FD (hexadecimal)and F1 (hexadecimal) when running ‘Angry Birds’ and A6 (hexadecimal) and96 (hexadecimal) when running ‘Leanback’. In some cases, the twoprogrammable predetermined colour values may have default values thatare common for many applications, such as, but not limited to OF(hexadecimal) and 01 (hexadecimal).

Reference is now made to FIG. 14 which illustrates the distribution offixed-length compression algorithms when 8×8 channel blocks arecompressed using one of the following fixed-length compressionalgorithms: the origin and delta compression algorithm (referred to inFIG. 14 as ‘DeltaBitx’ wherein the number x indicates the number ofdelta bits that were used); the predetermined pixel colour compressionalgorithm wherein the predetermined colour value is the clear colourvalue (referred to in FIG. 14 as ‘ClearColour’); the predeterminedchannel colour compression algorithm wherein there are fourpredetermined channel colours of 00 (hexadecimal), FF (hexadecimal), OF(hexadecimal) and 01 (hexadecimal) (referred to in FIG. 14 as‘ConstBytex’ wherein the number x indicates which of the fourpredetermined channel colour values numbered from 0 to 3 was used); andthe look-up table compression algorithm (referred to in FIG. 14 as‘TableEntryBix’ wherein the number x indicates the number of indexbits). As ‘TableEntryBit0’ (i.e. the look-up table compression algorithmwith zero index bits) is equivalent to the common value compressionalgorithm, the notation ‘TableEntryBit0’ is used in this example toindicate that the common value compression algorithm was used.

Accordingly, in the predetermined colour value compression algorithm(either the pixel colour value version or the channel colour valueversion) the common base information is the information identifying onecolour of the one or more predetermined colours and the fixed-lengthparameters have zero bit length (i.e. no fixed-length parameters arestored).

It will be evident to a person of skill in the art that these areexample fixed-length compression algorithms only and that anyfixed-length compression algorithm in which the compressed data for anycolour value can be randomly accessed may be used in the method 200 ofFIG. 2.

Example Compressed Block Formats

Example formats for the compressed blocks generated in accordance withthe method 200 of FIG. 2 will now be described.

Reference is now made to FIG. 15 which illustrates a first exampleformat for a compressed block 1500 of image data where the channelblocks are not divided into sub-blocks prior to compression (i.e. eachchannel block is compressed in its entirety or left uncompressed). Inthis example there are four channels and thus four channel blocks,however it will be evident to a person of skill in the art that this isan example only and that the method and techniques described herein maybe applied to image data with a different number of channels.

The example compressed block 1500 comprises a header 1502 and a body1504. The header 1502 comprises information indicating which channelblocks were compressed, and for each compressed channel block comprises:information indicating the fixed-length compression algorithm used tocompress that channel block, the size or length of the fixed-lengthparameter, and the common base information for that channel block. Thebody 1504 comprises the raw or uncompressed colour values for eachuncompressed channel block and the fixed-length parameters for eachcompressed channel block.

In FIG. 15 the header 1502 comprises a length or size field 1506, 1508,1510, 1512 for each channel block that indicates whether or not thatchannel block was compressed, and if compressed, indicates thecompression algorithm used to compress the channel block and the lengthor size of the fixed-length parameter. In the example shown in FIG. 15each length or size field 1506, 1508, 1510, 1512 is 4-bits, a 0 (‘0000’(binary)) indicates that the corresponding channel block was compressedusing the common value compression algorithm; any number between 1(‘0001’ (binary)) and 7 (‘0111’ (binary)) indicates that thecorresponding channel block was compressed using the origin and deltacompression algorithm and the parameter length (i.e. the number of deltabits) is equal to that number; and an 8 (‘1000’ binary) indicates thatthe corresponding channel block was not compressed and the raw ororiginal colour values of that channel block are included in thecompressed block. This is summarized in Table 2.

TABLE 2 Size Field Compression Parameter (binary) Raw Algorithm Length0000 N Common 0 Value 0001-0111 N Origin and Value in Delta Size Field1000 Y — —

Accordingly, in the example shown in FIG. 15 the length field 1506, 1512for channels 0 and 3 is set to eight (‘1000’ (binary)) indicatingchannels 0 and 3 were not compressed; the length field 1508 for channel1 is two (‘0010’ (binary)) indicating channel 1 was compressed using theorigin and delta compression algorithm and the length of thefixed-length parameter is two bits; and the length field 1510 forchannel 2 is set to zero (‘0000’ (binary)) indicating channel 2 wascompressed using the common value compression algorithm and thefixed-length parameter is zero bits (i.e. no fixed-length parameter isstored for this channel block).

The header 1502 also comprises a common base information field 1514,1516 for each compressed channel block that indicates the common baseinformation which, combined with the fixed-length parameter for a colourvalue, can be used to obtain the raw or original colour value. In thisexample, only channels 1 and 2 have been compressed so the header 1502comprises a common base information field 1514, 1516 for channels 1 and2 only. The common base information is generally based on thefixed-length compression algorithm used to compress the channel block.In this example, channel 1 was compressed according to the origin anddelta compression algorithm so the common base information field 1514comprises the origin value (e.g. minimum colour value); and channel 2was compressed according to the common value compression algorithm sothe common base information field 1516 comprises the common colourvalue.

The body 1504 comprises the colour values for any uncompressed channelblocks and the fixed-length parameters for any compressed channelblocks. The colour values and/or fixed-length parameters may be storedin the body 1504 in any suitable manner that allows the fixed-lengthparameters and/or colour values associated with any pixel to be randomlyaccessible. In some cases, as shown in FIG. 15, the fixed-lengthparameters and/or colour values that correspond to the same pixel arepacked together to form a pixel data unit 1518. In the example shown inFIG. 15, channels 0 and 3 are uncompressed and channels 1 and 2 arecompressed, therefore each pixel data unit 1518 comprises theuncompressed colour value for channel 0, the fixed-length parameter forchannel 1, the fixed-length parameter for channel 2, and theuncompressed colour value for channel 3. However, in this particularexample since channel 2 was compressed with the common value compressionalgorithm the fixed-length parameter has 0 bits, so no fixed-lengthparameter is actually stored for channel 2. The pixel data units 1518may be stored in the body 1504 in any order. For example, the pixel dataunits 1518 may be stored in a Morton (or Z) order or scan line orderwithin the block.

Reference is now made to FIG. 16 which illustrates a second exampleformat for a compressed block 1600 of image data generated in accordancewith the method 200 of FIG. 2 where the channel blocks are not dividedinto sub-blocks prior to compression (i.e. each channel block iscompressed in its entirety or left uncompressed). In this example, likethe example of FIG. 15, there are four channels and thus four channelblocks, however it will be evident to a person of skill in the art thatthis is an example only and that the methods and techniques may beapplied to image data with a different number of channels. The examplecompressed block 1600 comprises a header 1602 and a body 1604. Like thecompressed block 1500 of FIG. 15, the header 1602 comprises informationindicating which channel blocks were compressed, and for each compressedchannel block comprises information indicating the compression algorithmthat was used to compress that channel block, the size or length of thefixed-length parameter, and the common base information for that channelblock; and the body 1604 comprises the raw or uncompressed colour valuesfor each uncompressed channel block and the fixed-length parameters foreach compressed channel block.

The header 1602 in this example comprises a compression algorithm field1606, 1608, 1610, 1612 for each channel block. Each compressionalgorithm field 1606, 1608, 1610, 1612 indicates whether or not thecorresponding channel block has been compressed or not, and ifcompressed it indicates the particular fixed-length compressionalgorithm that was used to compress the channel block. In this examplethe compression algorithm field is two bits and a 0 (‘00’ (binary)) inthe compression field for a channel block indicates that the channelblock was not compressed (and that raw original colour values arestored) and anything else indicates that the channel block wascompressed, and the particular fixed-length compression algorithm usedto compress the channel block. Specifically, in this example a 1 (‘01’(binary)) indicates that the common value compression algorithm was usedto compress the channel block; a 2 (‘10’ (binary)) indicates that theorigin and delta compression algorithm was used to compress the channelblock; a 3 (‘10’ (binary)) indicates that the look-up table compressionalgorithm was used to compress the channel block. This is summarized inTable 3.

TABLE 3 Compression Algorithm Compression Field Raw Algorithm 00 Y — 01N Common Value 10 N Origin and Delta 11 N Look-up Table

In the example shown in FIG. 16, the compression algorithm fields 1606,1608, 1610 and 1612 indicate that channels 0 and 3 were not compressed,and that channels 1 and 2 were compressed using the common value, andorigin and delta compression algorithms respectively. If a channel blockis not compressed then, as described in more detail below, the bodycomprises the original or uncompressed colour values for that block.

In the example of FIG. 16 the header 1602 also comprises a length orsize field 1614, 1616 for each compressed channel block that indicatesthe length or size of the fixed-length parameter. In this example onlychannels 1 and 2 have been compressed so the header 1602 only comprisesa length or size field 1614, 1616 for channels 1 and 2. In this example,the length or size field 1614, 1616 is three bits which can be used toindicate a size or length ranging from 0 bits to 7 bits. Specifically,channel 1 has a fixed-length parameter of 0 bits (i.e. it was compressedusing the common value compression algorithm, so no fixed-lengthparameters are stored) and channel 2 has a fixed-length parameter of 3(i.e. the fixed-length parameters are each 3 bits). However, it will beevident to a person of skill in the art that this is an example only andthat the length or size field 1614, 1616 may have any suitable number ofbits and/or format. In some cases, there may not be a length or sizefield for blocks compressed using the common value compression algorithmas it is known from the compression field that the length of thefixed-length parameter is zero bits.

The header 1602 also comprises a common base information field 1618,1620 for each compressed channel block that indicates the common baseinformation which, combined with the fixed-length parameter for a colourvalue, can be used to obtain the raw or original colour value. In thisexample, only channels 1 and 2 have been compressed so the header 1602only comprises common base information fields 1618, 1620 for channels 1and 2. The common base information is generally based on thefixed-length compression algorithm used to compress the channel block.In this example channel 1 was compressed using the common valuecompression algorithm so the common base information field 1618 forchannel 1 comprises the common value; and channel 2 was compressed usingthe origin and delta compression algorithm so the common baseinformation field 1620 for channel 2 comprises the origin value.

The body 1604, like the body 1504 of FIG. 15, comprises the colourvalues for any uncompressed channel blocks and the fixed-lengthparameters for any compressed channel blocks. The colour values and/orfixed-length parameters may be stored in the body 1604 in any suitablemanner that allows the fixed-length parameters and/or colour values tobe randomly accessible. In some cases, as described above, thefixed-length parameters and/or colour values that correspond to the samepixel are packed together to form a pixel data unit 1622. Since in theexample shown in FIG. 16, channels 0 and 3 are uncompressed and channels1 and 2 are compressed each pixel data unit 1622 comprises theuncompressed colour value for channel 0, the fixed-length parameter forchannel 1, the fixed-length parameter for channel 2, and theuncompressed colour value for channel 3. However, since channel 1 wascompressed using the common value compression algorithm the fixed-lengthparameter has a length of 0 bits, so no fixed-length parameter is storedfor channel 1. The pixel data units 1622 may be stored in the body 1604in any order. For example, as described above, the pixel data units 1622may be stored in Morton (or Z) order or scan line order within theblock.

Reference is now made to FIG. 17 which illustrates an example format fora compressed block 1700 of image data where each channel block isdivided into four sub-blocks and each sub-block can be compressed orleft uncompressed. In this example there are four channels and thus fourchannel blocks, however it will be evident to a person of skill in theart that this is an example only and that the methods and techniques maybe applied to image data with a different number of channels. Forexample, as shown in FIG. 18 the block of image data 1800 may compriseRGBA image data for a 16×16 block of pixels. The image data 1800 can bedivided into four 16×16 channel blocks 1802, 1804, 1806, 1808—i.e. a16×16 block 1802 of colour values for channel 0 (red channel); a 16×16block 1804 of colour values for channel 1 (green channel); a 16×16 block1806 of colour values for channel 2 (blue channel); and a 16×16 block1808 of colour values for channel 3 (opacity channel). In this example,prior to compression, each channel block 1802, 1804, 1806, 1808 isdivided into four 8×8 sub-blocks—sub-block zero 1810, 1820, 1830, 1840,sub-block one 1812, 1822, 1832, 1842, sub-block two 1814, 1824, 1834,1844, and sub-block three 1816, 1826, 1836, 1846.

Like the compressed blocks 1500 and 1600 of FIGS. 15 and 16, thecompressed block 1700 of FIG. 17 comprises a header 1702 and a body1704. The header 1702 comprises information indicating which sub-blockswere compressed, and for each compressed sub-block comprises informationindicating the compression algorithm used to compress that sub-block,the size or length of the fixed-length parameter, and the common baseinformation for that sub-block; and the body 1704 comprises the raw oruncompressed colour values for the uncompressed channel sub-blocks andthe fixed-length parameters for the compressed channel sub-blocks.

The header 1702 of FIG. 17 is similar to the header 1602 of FIG. 16 inthat it comprises: compression algorithm fields 1706, 1708, 1710, 1712,1714, 1716, 1718, 1720, 1722, 1724, 1726, 1728, 1730, 1732, 1734, 1736;length or size fields 1738, 1740, 1742, 1744, 1746, 1748; and commonbase information fields 1750, 1752, 1754, 1756, 1758 and 1760. However,where the header 1602 of FIG. 16 only comprises a single set ofcompression algorithm fields, length or size fields, and common baseinformation fields, the header 1702 of FIG. 17 comprises a set ofcompression algorithm fields, length or size fields, and common baseinformation fields for each sub-block of the image data. Each set ofcompression algorithm fields, length or size fields, and common baseinformation fields works the same way as the compression algorithmfields, length or size fields, and common base information fields ofFIG. 16 except instead of describing the compression (or lack thereof)of a channel block they describe the compression of a channel sub-block.Specifically, for each sub-block of the image data there is: acompression algorithm field for each channel that indicates whether thatchannel sub-block has been compressed and if so, by which algorithm; alength or size field for each compressed channel sub-block thatindicates the length of the fixed-length parameter for that compressedchannel sub-block; and a common base information field for eachcompressed channel sub-block that comprises the common base informationfor that compressed channel sub-block.

It will be evident to a person of skill in the art that this is only anexample format for the header 1702 and the header 1702 may take anysuitable format. For example, in other cases, instead of the headercomprising a set of compression algorithm fields, length or size fields,and common base information fields for each sub-block as described withreference to FIG. 16, the header may comprises a set of length or sizefields and common base information fields for each sub-block asdescribed with reference to FIG. 15.

The body 1704 of FIG. 17 includes the fixed-length parameters for eachcompressed channel sub-block and the original colour values for eachuncompressed channel sub-block. The fixed-length parameters and/ororiginal colour values may be stored in the body 1704 in any suitablemanner in which they can be randomly accessed. In some cases, such as inthe example shown in FIG. 17, the fixed-length parameters and/ororiginal colour values are grouped by sub-block to form a sub-block dataunit 1762, 1764, 1766, 1768. Within each sub-block data unit 1762, 1764,1766, 1768 the fixed-length parameters and/or colour values related tothe same pixel may be packed together to form a pixel data unit 1770 asdescribed above with respect to FIGS. 15 and 16. For example, if for aparticular sub-block, channels 0 and 1 are not compressed and channels 2and 3 are compressed then each pixel data unit for that sub-block maycomprise the original uncompressed colour value for channel 0, theoriginal uncompressed colour value for channel 1, the fixed-lengthparameter for channel 2, and the fixed-length parameter for channel 3.

To improve the memory usage and bandwidth efficiency the sub-block dataunits 1762, 1764, 1766, 1768 may be packed together. The sub-block dataunits 1762, 1764, 1766, 1768 may be packed at any granularity such as,but not limited to, bytes or 4-byte words (i.e. the next sub-block maystart at the next byte after the previous sub-block ends or the nextsub-block may start at the next 4-byte word after the previous sub-blockends).

Although the start of each sub-block data unit 1762, 1764, 1766, 1768can be determined from the length information and/or the compressionalgorithm information, in some cases the header 1702 may also include anoffset field for each sub-block that indicates the location (e.g.address) within the body at which the sub-block data unit 1762, 1764,1766, 1768 for that sub-block starts. This may allow the compressed datafor a particular sub-block to be located more quickly, however itincreases the size and complexity of the header 1702. In some cases, theoffset field may indicate the address offset with respect to the startof the body 1704 at which the corresponding sub-block data unit begins.Using an offset, as opposed to the actual address, allows a smallernumber of bits to be used to specify the address of the sub-block dataunit.

It will be evident to a person of skill in the art that these areexample formats for compressed blocks generated in accordance with themethod 200 of FIG. 2 and that the compressed blocks may take anysuitable form.

Dynamic Selection of Fixed-Length Compression Algorithm

In some cases, the fixed-length compression algorithm that is used tocompress a channel block/sub-block in step 206 of the method 200 of FIG.2 may be dynamically selected based on the diversity of the colourvalues in the channel block/sub-block. For example, in some cases, priorto compressing a channel block/sub-block the colour values of thechannel block/sub-block are analysed to generate one or more diversitystatistics that indicate the diversity of the colour values in thechannel block/sub-block. One of a plurality of fixed-length compressionalgorithms is then selected for the channel block/sub-block based on thediversity statistic(s). Diversity statistics may include, but are notlimited to, the number of unique colour values in the channelblock/sub-block, the range of the colour values in the channelblock/sub-block (or statistics from which the range may be determinedsuch as the minimum and maximum colour values) and/or any other suitablestatistic.

Reference is now made to FIG. 19 which illustrates a first examplemethod 1900 for dynamically selecting a fixed-length compressionalgorithm for compressing a channel block/sub-block. In this examplemethod 1900 either the common value compression algorithm or the originand delta compression algorithm may be used to compress channelblocks/sub-blocks. The method 1900 begins at step 1902 where a channelblock/sub-block is received (e.g. a 32×32 or 16×16 block of colourvalues for a channel). Once the channel block/sub-block has beenreceived, the method 1900 proceeds to step 1904 where diversitystatistics are generated for the received channel block/sub-block. Inthis example, the diversity statistics may include the range of thecolour values in the channel block/sub-block (or statistics from whichthe range may be determined such as the minimum and maximum colourvalues in the block/sub-block). The range may be determined using anysuitable method, such as, but not limited to, the modulo methoddescribed above. Once the diversity statistics are generated, the method1900 proceeds to step 1906 where a determination is made as to whetherthe range is zero (i.e. all the colour values in the channelblock/sub-block are the same). If the range is zero, then the commonvalue compression algorithm is selected at step 1908 to compress thechannel block/sub-block. If, however, the range is not zero (indicatingthere are at least two different colour values in the channelblock/sub-block) then a determination is made at step 1910 as to whetherthe range can be represented with fewer delta bits than the raw ororiginal colour values. For example, if the raw or original colourvalues are each 8-bits then a determination is made as to whether therange can be represented with fewer than 8-bits. If it is determined atstep 1910 that the range can be represented with fewer delta bits thanthe raw or original colour values, then the origin and delta compressionalgorithm may be selected at step 1912 to compress the channelblock/sub-block. If, however, it is determined at step 1910 that therange cannot be represented with fewer delta bits than the raw ororiginal colour values then at step 1914 a determination is made not tocompress the channel block/sub-block.

Reference is now made to FIG. 20 which illustrates a second examplemethod 2000 for dynamically selecting a fixed-length compressionalgorithm for a channel block/sub-block. In this example method 2000 anyof: the common value compression algorithm, the origin and deltacompression algorithm, and the look-up table compression algorithm maybe used to compress a channel block/sub-block. The method 2000 begins atstep 2002 where a channel block/sub-block is received (e.g. a 32×32 or16×16 block of colour values for a channel). Once the channelblock/sub-block has been received, the method 2000 proceeds to step 2004where diversity statistics are generated for the received channelblock/sub-block. In this example, the diversity statistics may includethe range of colour values in the channel block/sub-block (or statisticsfrom which the range may be determined such as the minimum and maximumcolour values) and the number of unique colour values in the channelblock/sub-block. The range may be determined using any suitable method,such as, but not limited to, the modulo method described above. Once thediversity statistics for the channel block/sub-block have beengenerated, the method 2000 proceeds to step 2006 where a determinationis made whether the number of unique colour values in theblock/sub-block is one (i.e. all the colour values in the channelblock/sub-block are the same). As the range will also be zero when thereis only one unique colour value in the channel block/sub-block thedecision may alternatively be based on the range. If it is determined instep 2006 that there is only one unique colour value in theblock/sub-block, then at step 2008 the common value compressionalgorithm is selected. If, however, it is determined at step 2006 thatthere is more than one unique colour value in the channelblock/sub-block then the method 2000 proceeds to step 2010.

At step 2010 a determination is made as to whether the number of uniquecolour values exceeds a threshold (e.g. 2, 3 or 4). If it is determinedat step 2010 that the number of unique colour values does not exceed thethreshold then the look-up table compression algorithm is selected tocompress the channel block/sub-block at step 2012. If, however, it isdetermined that the number of unique colour values does exceed thethreshold then the method 2000 proceeds to step 2014 where adetermination is made as to whether the range can be represented withfewer bits than the raw or original colour values. For example, if theraw or original colour values are each 8-bits then a determination ismade as to whether the range can be represented with fewer than 8-bits.If it is determined at step 2014 that the range can be represented withfewer bits than the raw or original colour values, then the origin anddelta compression algorithm is selected to compress the channelblock/sub-block at step 2016. If, however, it is determined at step 2014that the range cannot be represented with fewer bits than the raw ororiginal colour values then at step 2018 a determination is made not tocompress the channel block/sub-block.

It will be evident to a person of skill in the art that these areexamples only and that any suitable criteria and/or method may be usedto select a fixed-length compression algorithm for compressing a channelblock/sub-block. For example, in some cases the compression algorithmthat would allow the channel block/sub-block to be represented by thesmallest amount of data may be selected to compress the channelblock/sub-block. For example, in some cases, if it is determined at step2010 of method 2000 of FIG. 20 that the number of unique colour valuesdoes not exceed the threshold, instead of proceeding directly to step2012, the total amount of data to store the channel block/sub-blockusing the look-up table compression algorithm may be determined(including the data in the look-up table and the indices for each colourvalue in the channel block/sub-block) and compared to the total amountof data to store the channel block/sub-block using the origin and deltacompression algorithm (including the common base information (e.g. theorigin value) and the delta values for each colour value in the channelblock/sub-block). If it is determined that the total amount of data tostore the channel block/sub-block using the look-up table compressionalgorithm is less than the total amount of data to store the channelblock/sub-block using the origin and delta compression algorithm, thenthe method may proceed to step 2012. If, however, it is determined thatthe total amount of data to store the channel block/sub-block using thelook-up table compression algorithm is greater than or equal to thetotal amount of data to store the channel sub-block using the origin anddelta compression algorithm, then the method may proceed to step 2016.

Although the methods described above for selecting a fixed-lengthcompression algorithm to compress a channel block/sub-bock (e.g. themethods 1900 and 2000 of FIGS. 19 and 20) are described as forming partof the method 200 of FIG. 2, in other examples the described methods maybe used independently of the method 200 of FIG. 2 to select afixed-length compression algorithm for a channel block/sub-block or foranother block of data.

Hierarchical Compression

In general, the larger the size of the block/sub-block that iscompressed, the simpler the header of the compressed block can be andthus the less header overhead. However, the colour values will be morediverse in a larger channel block/sub-block, therefore the number ofbits needed to represent the colour values in larger channelblocks/sub-blocks is generally higher. As shown in FIGS. 8-10, thepercentage of channel blocks/sub-blocks that required a higher number ofdelta bits increased for channel block/sub-block sizes of 16×16 pixelsand 32×32 pixels compared with channel block/sub-block sizes of 8×8pixels. Experiments have shown that in the Manhattan 3.0 benchmark testthe total compressed data size when the origin and delta compressionalgorithm was used increased 8% each time the compression block sizeincreased. Specifically, in the Manhattan 3.0 benchmark test compressingthe channel blocks using the origin and delta compression algorithm in8×8 blocks reduced the size of the image data 61% relative to theuncompressed image data; in 16×16 blocks reduced the size of the imagedata 54%; and in 32×32 blocks reduced the size of the image data 46%.Accordingly, in general, the smaller the size of the block/sub-blockthat is compressed the better the compression. However, there will besome channel blocks which can be compressed well using a larger blocksize.

Therefore, to improve the efficiency of compression without losing theability to represent large blocks of similar colour values efficiently,in some cases a hierarchical compression scheme, which may also bereferred to herein as a multi-level compression scheme, may beimplemented. In a hierarchical compression scheme the blocks of thechannel block that are compressed together (i.e. as a unit) aredynamically selected from a plurality of block sizes. For example,instead of determining in advance that a 32×32 channel block is going tobe divided into sixteen 8×8 blocks which are compressed individually, itmay be dynamically determined whether the 32×32 channel block is to becompressed as a 32×32 block or as sixteen 8×8 blocks. In some examples,non-square block sizes may be used. For example, block sizes of 32×16,16×32, 16×8, or 8×16 may also be considered.

In some cases, there may be more than two sizes or levels of compressionto choose from. For example, a 32×32 channel block may be compressed ata 32×32 block level, a 16×16 block level or an 8×8 block level. In thesecases, a channel block may be compressed using any combination of thelower level blocks. For example, the 32×32 block may be compressed as a32×32 block or any combination of 16×16 and 8×8 blocks. For example, one16×16 block may be compressed as a unit whereas the other 16×16 blocksmay be compressed as 8×8 blocks.

In these cases, the method 200 of FIG. 2 further comprises selecting theblocks of each channel block to compress. In general, the more diversethe colour values in a channel block, the smaller the size of the blocksthat are compressed, and, the less diverse the colour values in thechannel block, the larger the size of the blocks that are compressed.

Any suitable criteria may be used to select the block(s) of a particularchannel block to compress. In some cases, the blocks of a particularchannel block to be compressed may be selected by starting with thelargest block size, determining whether the channel can be suitablycompressed at that size and if not, dividing that block into a pluralityof sub-blocks and, if the sub-block is not the minimum block size,repeating the method for each sub-block (i.e. determine whether thatsub-block can be compressed at that block-size and if not, dividing thatblock into a plurality of sub-blocks) until a suitable compressionalgorithm is selected for each sub-block or the smallest block-size hasbeen reached.

For example, FIG. 21 shows a channel block 2100 that comprises a 32×32block of colour values which can be divided into four 16×16 sub-blocks2102-0, 2102-1, 2102-2, 2102-3, each of which can be divided into four8×8 sub-blocks 2104-0, 2104-1, 2104-2, 2104-3, 2104-4, 2104-5, 2104-6,2104-7, 2104-8, 2104-9, 2104-10, 2104-11, 2104-12, 2104-13, 2104-14,2104-15. In this example, the channel block 2100 can be compressed usingany combination of 32×32, 16×16 and 8×8 blocks. In this example, adetermination is first made as to whether the 32×32 channel block can besuitably compressed as a 32×32 block. If it is determined that thechannel block can be compressed as a 32×32 block, then the 32×32 blockis compressed. If, however, it is determined that the channel blockcannot be suitably compressed as a 32×32 block then the 32×32 block isdivided into four 16×16 blocks and a determination is made for each16×16 block whether that block can be suitably compressed. If any 16×16block can be suitably compressed, then that 16×16 block is compressed.If, however, any 16×16 block cannot be suitably compressed as a 16×16block then that 16×16 block is divided into 8×8 blocks and the 8×8blocks are compressed (or not compressed). In some cases, thedetermination of whether the channel block/sub-block can be suitablycompressed at that block size is based on the size of the fixed-lengthparameter for that channel block/sub-block.

This may result in, for example, the entire 32×32 block being compressedtogether, each 16×16 block being compressed together, one to three 16×16blocks being compressed together (e.g. blocks 2102-0, 2102-1, and2102-2) and the remaining 16×16 block(s) (e.g. block 2102-3) beingcompressed as 8×8 blocks (e.g. blocks 2104-12, 2104-13, 2104-14,2104-15); or all the 8×8 blocks being individually compressed.

Reference is now made to FIG. 22 which illustrates an example method2200 for selecting the blocks of a channel block to be compressed whichmay be implemented by a compression unit, such as the compression unit2400 described below. The method 2200 begins at step 2202 where achannel block (e.g. a 32×32 block of colour values for a particularchannel) to be compressed is received. Once the channel block has beenreceived the method 2200 proceeds to step 2204 where the receivedchannel block is placed on a list of blocks to be compressed. The method2200 then proceeds to step 2206 where it is determined whether the listof blocks to be compressed is empty. If it is determined that the listis empty, then the compression of the channel block is complete, and themethod 2200 ends. If, however, there is at least one block in the listof blocks to be compressed then the method 2200 proceeds to step 2208where one of the blocks in the list of blocks to be compressed isselected and removed from the list. In the first iteration of step 2208the channel block will be selected. In any other iteration of block 2208(if necessary) a channel sub-block will be selected. Once a block hasbeen selected from the list of blocks to be compressed, the method 2200proceeds to step 2210.

At step 2210, a fixed-length compression algorithm for compressing theblock is selected or identified. Any suitable method, such as, but notlimited to, those described above with reference to FIGS. 19 and 20, maybe used to select or identify a fixed-length compression algorithm forcompressing the block. Once a fixed-length compression algorithm forcompressing the block has been selected or identified the method 2200proceeds to step 2212.

At step 2212, it is determined whether the selected block is the minimumblock size. If the selected block is the minimum block size, then theselected block has to be compressed at this level or left uncompressed(i.e. it cannot be divided into sub-blocks for compression). If,however, the selected block is not the minimum sized block then theblock may only be compressed at this level if it can be suitablycompressed using the selected or identified fixed-length compressionalgorithm. If it cannot be suitably compressed using the selected oridentified fixed-length compression algorithm it may be divided intosub-blocks which may be individually compressed. Accordingly, if it isdetermined at step 2212 that the selected block is of the minimum blocksize, then the method 2200 proceeds to step 2214 where the selectedblock is compressed using the selected or identified fixed-lengthcompression algorithm (which may include storing the raw or originalcolour values). If, however, it is determined at step 2212 that theselected block is not the minimum block size (i.e. it is larger than aminimum sized block) then the method 2200 proceeds to step 2216.

At step 2216, the size of the fixed-length parameter when the selectedfixed-length compression algorithm is used to compress the selectedblock is determined. Once the size of the fixed-length parameter isdetermined, the method 2200 then proceeds to step 2218. At step 2218, adetermination is made as to whether the size of the fixed-lengthparameter exceeds a threshold which indicates that the block can besuitably or efficiently compressed. In some cases, the threshold may be0 meaning that a higher level block size is only used if all the colourvalues in the block are the same. In other cases, the threshold may beanother small number such as, but not limited to, 1, 2 or 3. In somecases, the threshold may be based on the size of the selected block.Therefore there may be different thresholds for different sized blocks(e.g. the 32×32 block threshold may be different than the 16×16 blockthreshold). If it is determined at step 2218 that the size does notexceed the threshold, then the method 2200 proceeds to step 2214 wherethe selected block is compressed using the selected or identifiedfixed-length compression algorithm.

If, however it is determined at step 2218 that the size of thefixed-length parameter exceeds the threshold (e.g. indicating that it isnot suitable or efficient to compress this entire block together) thenthe method 2200 proceeds to steps 2220 and 2222 where the block isdivided into a plurality (e.g. n) of sub-blocks and the sub-blocks areadded to the list of blocks to be compressed. The number and size of thesub-blocks may be based on the size of the selected block and the blocksizes supported by the compression unit. In some cases, the selectedblock is divided into sub-blocks of the next smallest supported blocksize. For example, if the channel block is a 32×32 pixel block and thecompression unit can compress the 32×32 pixel block at the 32×32 pixelblock level, the 16×16 pixel block level or an 8×8 pixel block level,then if the selected block is a 32×32 pixel block it may be divided intofour 16×16 pixel blocks, and if the selected block is a 16×16 pixelblock it may be divided into four 8×8 pixel blocks. Once the sub-blockshave been added to the list of blocks to be compressed, steps 2210 to2222 are repeated for each sub-block.

Specifically, for each sub-block, a fixed-length compression algorithmis selected or identified for that sub-block. If the sub-block is thesmallest supported block size then the sub-block is compressed using theselected or identified fixed-length compression algorithm. If, however,the sub-block is not the minimum supported block size the size of thefixed-length parameter for the selected fixed-length compressionalgorithm is determined. If the size of the fixed-length parameter doesnot exceed the threshold then the sub-block is compressed according tothe selected fixed-length compression algorithm. If, however, the sizeof the fixed-length parameter for the selected fixed-length compressionalgorithm exceeds the threshold then the sub-block is furthersub-divided into sub-sub-blocks or mini-blocks and the sub-sub-blocks ormini blocks are added to the list of block to be compressed. The methodis then repeated for the sub-sub-blocks or the mini blocks until theentire channel block has been compressed.

It will be evident to a person of skill in the art that where there isonly one fixed-length compression algorithm or the fixed-lengthcompression algorithm for a selected block is predetermined then step2210 may be omitted for that block.

It will be evident to a person of skill in the art that this is anexample method only and that other suitable methods may be used toselect the blocks of a channel block to be compressed. For example,other methods may work in reverse—i.e. they may start with the lowestlevel blocks and only if it is possible to compress the lower levelblocks with a certain number of bits is the higher level blockconsidered for compression.

When a hierarchical compression scheme is implemented the compressedblock (e.g. the header of the compressed block) may also compriseinformation indicating which blocks of each channel have beencompressed. For example, in some cases, the header of the compressedblock may comprise for each compression level, information for eachblock at that level, that indicates whether that block has beencompressed together for each channel. For example, RGBA image data for a32×32 block of pixels comprises four 32×32 channel blocks of colourvalues. If each channel block can be compressed as a 32×32 block, as oneor more 16×16 blocks and/or one or more 8×8 blocks then there are threecompression levels—level 1: compression of a 32×32 block; level 2:compression of 16×16 blocks; and level 3: compression of 8×8 blocks. Inthis example there is one block at level 1 thus the header of thecompressed block may comprise information for that block that indicateswhether that block has been compressed for each channel. There are fourblocks at level 2 thus the header may comprise information for each ofthese four blocks that indicate whether that block has been compressedfor each channel. There are sixteen blocks at level 3 thus the headermay comprise information for each of these sixteen blocks that indicatewhether that block has been compressed for each channel.

Reference is now made to FIG. 23 which illustrates an example header2302 for a compressed block of image data that has been generated usinga hierarchical compression scheme (i.e. the blocks and the sizes thereofthat are compressed are dynamically selected). In this example, theheader is generated for a 32×32 block of image data with four channelssuch that each of the four channel blocks comprises a 32×32 block ofcolour values like the channel block 2100 of FIG. 21. In this examplethere are three possible levels of compression—level 1: 32×32 block,level 2: 16×16 blocks; and level 3: 8×8 blocks. However, it will beevident to a person of skill in the art that this is an example only andthat the techniques and principles described herein may be applied todifferent sized image/channel blocks that can be compressed at differentblock sizes.

The header 2302 of FIG. 23 is divided into a level 1 section 2304, alevel 2 section 2306 and a level 3 section 2308. Each section 2304,2306, 2308 comprises information for each block at that level thatindicates whether that block is compressed for each channel. Eachsection 2304, 2306, 2308 also comprises information indicating thelength or size of the fixed-length parameter and the common baseinformation for any block at that level that is compressed. In somecases, the corresponding section will also include information thatindicates the fixed-length compression algorithm which was used tocompress the block.

In the example shown in FIG. 23, each section 2304, 2306, 2308 comprisesa set of compression fields (one for each channel) for each block atthat level that indicates whether or not that channel block iscompressed at that level. For example, at level 1 there is only oneblock—the 32×32 block—so the level 1 section 2304 comprises a set offour compression fields 2310, 2312, 2314, 2316 (one for each channel)which indicates whether the 32×32 block of that channel was compressed.For example, the first compression field 2310 indicates whether the32×32 block was compressed for channel 0, the second compression field2312 indicates whether the 32×32 block was compressed for channel 1, thethird compression field 2314 indicates whether the 32×32 block wascompressed for channel 2 and the fourth compression field 2316 indicateswhether the 32×32 block was compressed for channel 3. In this example, a‘1’ in a compression field indicates that the block was compressed forthat channel and a ‘0’ indicates that the block of that channel was notcompressed. When the compression field indicates that a block iscompressed for a channel at a particular level, it indicates that thechannel block is represented at that level in the encoding using one ofthe available compression methods, which, it should be noted, may alsoinclude a raw (or not compressed) mode. Accordingly, the level 1 section2304 of FIG. 23 indicates that only channel 3 was compressed as a 32×32block. Similarly, at level 2 there are four blocks (i.e. four 16×16blocks) so the level 2 section 2306 comprises a set of four compressionfields (i.e. one for each channel) for each of the four 16×16 blockswhich indicates whether the 16×16 block of that channel was compressed.There are therefore sixteen compression fields at level 2, of whicheight are illustrated as fields 2322, 2324, 2326, 2328, 2334, 2336,2338, and 2340. Similarly, at level 3 there are sixteen blocks (i.e.sixteen 8×8 blocks) so the level 3 section 2308 comprises a set of fourcompression (i.e. one for each channel) for each of the sixteen 8×8blocks which indicates whether the 8×8 block of that channel wascompressed. There are therefore sixty four compression fields at level3, of which eight are illustrated as fields 2342, 2344, 2346, 2348,2358, 2360, 2362, and 2364.

If the compression field for any block indicates that the block iscompressed for a channel then the corresponding section 2304, 2306 and2308 of the header 2302 also comprises information indicating the sizeor length of the fixed-length parameter and the common base informationfor that block for that channel. Specifically, in the example shown inFIG. 23 for any block that was compressed for a channel thecorresponding section 2304, 2306, 2308 of the header 2302 comprises alength field 2318, 2330, 2350, 2352, 2366, 2368, 2370 that indicates thelength or size of the fixed-length parameter for that block; and acommon base information field 2320, 2332, 2354, 2356, 2372, 2374, 2376that indicates the common base information for that block. For example,the first 16×16 block (i.e. 16×16 block 0) is compressed for channel 2only so the level 2 section 2306 comprises a length field 2330 andcommon base information field 2332 for channel 2 for that block.Similarly, the last 8×8 block (i.e. 8×8 block 15) is compressed forchannels 0, 1 and 2 so the level 3 section 2308 comprises a length field2366, 2368, 2370 and a common base information field 2372, 2374, 2376for each of channels 0, 1 and 2. The length field and the common baseinformation field may be configured as described above with respect toFIG. 15.

It will be evident to a person of skill in the art that this is anexample header only and that the header may take any suitable form. Forexample, in other cases, instead of having a length field and commonbase information field for each compressed block there may be acompression algorithm field, a length field and a common baseinformation field as described with respect to FIG. 16. In yet othercases, instead of having a separate compression field and length fieldthere may be a single length field which indicates whether or not theblock is compressed, and if so, indicates the compression algorithm andthe length or size of the fixed-length parameter. For example, asdescribed above with respect to FIG. 15 there may be a 4-bit lengthfield where a 0 (‘0000’ (binary)) indicates that the correspondingchannel block was compressed using the common value compressionalgorithm; any number between 1 (‘0001’ (binary)) and 7 (‘0111’(binary)) indicates that the corresponding channel block was compressedusing the origin and delta compression algorithm and the parameterlength (i.e. the number of delta bits) is equal to that number; an 8(‘1000’ (binary)) indicates that the corresponding channel block was notcompressed and the raw or original colour values of that channel blockare included in the compressed block; and a 15 (‘1111’ (binary))indicates that the corresponding channel block was not compressed (or,not encoded) at this level. This is summarised in Table 4.

TABLE 4 Is the channel block Size Field compressed/encoded CompressionParameter (binary) at this level? Raw Algorithm Length 0000 Y N Common 0Value 0001-0111 Y N Origin and Value in Delta Size Field 1000 Y Y — —1111 N — — —

Where the hierarchical compression scheme is used to compress a block ofimage data the fixed-length parameters and/or original colour values maybe stored in the body at the smallest block level. For example, if eachchannel block can be compressed at a 32×32 block level or an 8×8 blocklevel then the fixed-length parameters and/or original colour valuescorresponding to each 8×8 image block may be stored or grouped together.This ensures that any pixel within a particular 8×8 block will berepresented by the same number of data bits allowing a particular pixelto be randomly accessible within that block. Specifically, either achannel will be compressed/not compressed at this level meaning that thenumber of bits per colour value for that channel are fixed by thecompression algorithm/no compression at this level or a channel will becompressed at a higher level meaning that the number of bits per colourvalue for that channel are fixed by the compression algorithm at thehigher level.

Although the hierarchical compression method is described as formingpart of the method 200 of FIG. 2, in other examples the hierarchicalcompression method may be used independently of the method 200 of FIG. 2to compress a channel block/sub-block or other image data (e.g. imagedata with only a single two-dimensional block of values). For example,in some cases the hierarchical compression method may be used tocompress colour data at the pixel level.

Compression

Reference is now made to FIG. 24 which illustrates an examplecompression unit 2400 (which may form part of thecompression/decompression unit 112 of FIG. 1) for compressing a block ofimage data using the method 200 of FIG. 2. The compression unit 2400comprises a header generation unit 2402 and a body generation unit 2404.

The header generation unit 2402 is configured to receive the block ofimage data to be compressed and generate the header for the compresseddata block based on the received image data. The received image datacomprises data for an n×m block of pixels which can be divided into ann×m block of colour values for each colour channel. As described above,the header of the compressed data block comprises information thatidentifies which blocks of each channel block are compressed and if ablock of a channel block is compressed, the header also comprisesinformation identifying the length or size of the fixed-lengthparameters for that block and the common base information for thatblock.

Where the blocks of each colour channel that are to be compressed andthe fixed-length compression algorithm to be used to compress thoseblocks are known then the header generation unit 2402 may be configuredto determine, for each block of the channel blocks to be compressed, thelength of the fixed-length parameters and the common base informationbased on the colour values in those blocks. For example, if each 8×8block of each channel block is to be compressed using the origin anddelta compression algorithm then the header generation unit may beconfigured to, for each 8×8 block: (i) analyse the colour values in theblock to determine the range of values in each 8×8 block; (ii) determinethe number of delta bits to represent the range; and (iii) identify theorigin value (e.g. the minimum value).

Where the fixed-length compression algorithm to be used to compress aparticular block of a channel block is not known in advance (i.e. is notpredetermined) then the header generation unit 2402 may also beconfigured to dynamically select the fixed-length compression algorithmto be used to compress that particular block. The header generation unit2402 may be configured to select one of a plurality of fixed-lengthcompression algorithms to be used to compress a particular block of achannel block in any suitable manner. For example, the header generationunit 2402 may be configured to select a fixed-length compressionalgorithm to be used to compress a block of a channel block inaccordance with any of the methods described above (e.g. method 1900 ormethod 2000 of FIGS. 19 and 20 respectively).

Where the particular blocks of a channel block that are to be compressedare not known in advance (i.e. they are not predetermined) then theheader generation unit 2402 may also be configured to dynamically selectthe blocks of the channel block that are to be compressed. Any suitablemethod, such as a hierarchical method 2200 described above with respectto FIG. 22 may be used to dynamically select the blocks of a channelblock that are to be compressed.

The body generation unit 2404 is configured to receive the block ofimage data and the header generated by the header generation unit 2402and compress one or more blocks of at least one channel block inaccordance with the header. Specifically, the body generation unit 2404compresses each of the one or more blocks of the at least one channel bygenerating a fixed-length parameter for each colour value of that blockbased on the information in the header. As described above, where theblocks to be compressed are known in advance (i.e. are predetermined)and the fixed-length compression algorithm(s) to be used to compressthose blocks is/are known in advance (i.e. is/are predetermined) thenthe header may comprise information identifying the length or size ofthe fixed-length parameter for each block to be compressed and thecommon base information. In these cases the body generation unit isconfigured to generate a fixed-length parameter for each colour value ineach relevant block based on the length of the fixed-length parameterfor that block and the common base information for that block inaccordance with the known fixed-length compression algorithm for thatblock. For example, if it is known in advance that each 8×8 block is tobe compressed using the origin and delta compression algorithm then thebody generation unit 2404 generates a delta value (of the specifiedlength) for each colour value in each 8×8 block that represents thedifference between the colour value and the origin value for that block.

Where the fixed-length compression algorithm(s) and/or the blocks to becompressed are not known in advance then the header may also compriseinformation indicating which blocks of each channel block are to becompressed and/or the fixed-length compression algorithm to be used tocompress the relevant blocks. In these cases, the body generation unit2404 may be configured to identify which blocks of each channel blockare to be compressed based on the information in the header and/or thefixed-length compression algorithm to be used to compress each of therelevant blocks.

Once the body generation unit 2404 has generated the fixed-lengthparameters for each block to be compressed, the body generation unit2404 may be configured to generate the body of the compressed block bycombining or merging the fixed-length parameters of each compressedblock and the raw colour values for each uncompressed block. Asdescribed above, in some cases, the body may be generated by packing thefixed-length parameter(s) and/or colour values for each pixel into apixel data unit, and then packing the pixel data units of each blocktogether.

In some cases, the body and the header may be merged (by the bodygeneration unit 2404 or another unit) to form a complete compressedblock. However, in other cases the body and the header may be outputseparately.

The body and header may be stored in memory (e.g. frame buffer) togetheror separately.

Decompression

Reference is now made to FIG. 25 which illustrates an exampledecompression unit 2500 (which may form part of thecompression/decompression unit 112 of FIG. 1) for decompressingcompressed image data generated in accordance with the method 200 ofFIG. 2 to provide a channel colour value for a selected pixel. Thedecompression unit 2500 comprises a header analysis unit 2502 which isconfigured to analyse the header to identify the common base informationfor the channel colour value for the selected pixel and the location ofthe fixed-length parameter or colour value for the channel colour valuefor the selected pixel in the body; a body analysis unit 2504 configuredto retrieve the fixed-length parameter or colour value from theidentified location in the body; and a colour value generation unit 2506configured to generate the colour value based on the common baseinformation and the fixed-length parameter; or the colour value. Theoperation of the decompression unit 2500 will now be described in detailwith respect to FIG. 26.

Reference is now made to FIG. 26 which illustrates an example method2600, which may be implemented by the decompression unit 2500 of FIG.25, for decompressing a compressed block of image data generated inaccordance with the methods described herein to produce a channel colourvalue for a selected pixel (which may be referred to herein as a pixelchannel colour value). The method 2600 begins at step 2602 where thecompressed block of image data is received at the decompression unit2500. As described herein, the compressed block of image data comprisesa header and a body. The header comprises information that indicates,for example, the blocks/sub-blocks that are compressed for each channel,and the length of the fixed-length parameter and the common baseinformation of each compressed block/sub-block. The body comprises thefixed-length parameters for each compressed block and the raw colourvalues for each uncompressed block.

As described above, in some cases, a whole channel block may becompressed such that the header comprises (i) a single set of commonbase information for that channel block, and (ii) informationidentifying the length of the fixed-length parameters; and the bodycomprises a fixed-length parameter for each colour value in the channelblock. In other cases, one or more sub-blocks of a channel block may becompressed. In these cases, the header comprises (i) a set of commonbase information for each compressed channel sub-block, and (ii)information identifying the length of fixed-length parameters for eachcompressed block, and the body comprises, for each compressed sub-block,a fixed-length parameter for each colour value in that sub-block. Forexample, where two sub-blocks of a channel block are compressed theheader may comprise (i) common base information that is common to thecolour values in the first sub-block and common base information that iscommon to the colour values in the second sub-block, and (ii)information indicating the length of the fixed-length parameters for thefirst sub-block and information indicating the length of thefixed-length parameters for the second sub-block; and the body maycomprise a first fixed-length parameter for each colour value in thefirst sub-block and a second fixed-length parameter for each colourvalue in the second sub-block. Where multiple channel sub-blocks arecompressed the different sub-blocks may have a different size and/orthey may be compressed by different fixed-length compression algorithms.For example, in a hierarchical compression scheme where a 32×32 channelblock may be compressed at a 32×32 block level, a 16×16 block level oran 8×8 block level the 32×32 block may be compressed as a 32×32 block orany combination of 16×16 and 8×8 blocks. For example, one 16×16 blockmay be compressed as a unit whereas the other 16×16 blocks may becompressed as 8×8 blocks. Similarly, where multiple channel sub-blocksare compressed different fixed-length compression algorithms may be usedto compress different sub-blocks.

Also, as described above, the compressed block of image data maycomprise information representing the colour values of a single channelblock or multiple channel blocks. Where the compressed block of imagedata comprises information representing the colour values of multiplechannel blocks (i.e. multiple colour channels) the header may compriseinformation indicating which block/sub-blocks of each channel have beencompressed and for each block/sub-block of a channel that has beencompressed the common base information and the length of thefixed-length parameter and, optionally the fixed-length compressionalgorithm that was used to compress that block/sub-block; and the bodymay comprise a fixed-length parameter for each colour value in acompressed channel block/sub-block and the colour value for eachuncompressed channel block/sub-block. Different channels may becompressed in different sized blocks/sub-blocks and/or with differentfixed-length compression algorithms.

Once the compressed block of image data has been received the method2600 proceeds to step 2604.

At step 2604, the header analysis unit 2502 analyses the header of thecompressed block to (i) determine the location in the body of thefixed-length parameter (if compressed) or the colour value (if notcompressed) for the channel colour for the selected pixel; and (ii)determine the common base information related to the channel colourvalue for the selected pixel (if compressed). In some cases the locationin the body of the fixed-length parameter (if compressed) or the colourvalue (if not compressed) may be based on the size of the fixed-lengthparameters for the compressed block/sub-block to which the desiredcolour value belongs.

Specifically, when a block of image data is compressed in accordancewith the methods described herein the colour values within the lowestblock/sub-block level that relate to a particular channel will berepresented by a fixed number of bits, thus if the bits that relate toeach colour value are stored in a predetermined order the bits in thebody of the compressed block that relate to a particular colour valuecan be determined from the number of bits used to represent the colourvalues of each channel.

For example, for a four-channel image, if the lowest block-level for thecompressed block is an 8×8 block then each channel 0 colour value inthat 8×8 block will be represented by the same number of bits b₀, eachchannel 1 colour value in that 8×8 block will be represented by the samenumber of bits b₁, each channel 2 colour value in that 8×8 block will berepresented by the same number of bits b₂, and each channel 3 colourvalue in that 8×8 block will be represented by the same number of bitsb₃. Thus, if all the bits that relate to the same pixel are packedtogether to form a pixel data unit, then each pixel data unit will haveb₀+b₁+b₂+b₃ bits. If the pixel data units for a block are then packedtogether in pixel order to form a block data unit then the start of thepixel data unit for the i^(th) pixel, wherein the first pixel isnumbered 0, is at the i*(b₀+b₁+b₂+b₃) bit from the start of the blockdata unit. As described above, in some cases, the start of the blockdata unit may be determined from the length of the fixed-lengthparameters; and, in other cases, the header may comprise an offset valuefor the block that indicates the offset from the start of the body ofthe compressed data block at which the block data unit begins.

The particular bits of the pixel data unit that correspond to aparticular colour value can then be determined from b₀, b₁, b₂, b₃ andthe ordering of the channels in the pixel data unit. For example, if thebits of each channel are packed together in the pixel data unit inchannel order, then the bits corresponding to the colour value forchannel 0 are the first b₀ bits in the pixel data unit; the bitscorresponding to the colour value for channel 1 are the b₁ bits startingfrom bit b₀; the bits corresponding to the colour value for channel 2are the b₂ bits starting from bit b₀+b₁; and the bits corresponding tothe colour value for channel 3 are the last b₃ bits starting from bitb₀+b₁+b₂.

If the fixed-length compression algorithm is not predetermined, theheader analysis unit 2502 may also determine, from the header, thefixed-length compression algorithm used to compress the channel colourvalue for the selected pixel. Once the location of the fixed-lengthparameter or colour value in the body, and the common base informationhave been determined from the header of the compressed block the method2600 proceeds to step 2606.

At step 2606, the body analysis unit 2504 retrieves the fixed-lengthparameter (if compressed) or the colour value (if not compressed) forthe channel colour value for the selected pixel from the location of thebody determined by the header analysis unit. Once the fixed-lengthparameter or the raw colour value has been retrieved from the body ofthe compressed block, the method 2600 proceeds to step 2608.

At step 2608, the colour value generation unit 2506 generates the rawcolour value from the retrieved colour value (if not compressed) or fromthe common base information and the fixed-length parameter (ifcompressed). How the original colour value is generated from the commonbase information and the fixed-length parameter is based on thefixed-length compression algorithm used to compress the channel colourvalue.

For example, if the common value compression algorithm was used tocompress the colour value then the common base information comprises thecommon colour value, the fixed-length parameter has zero bits, and thecommon colour value is used as the channel colour value; if the originand delta compression algorithm was used to compress the colour valuethen the common base information comprise the origin value, thefixed-length parameter comprises a delta value representing thedifference between the origin value and the colour value, and thedesired colour value is generated by adding the origin value and thedelta value (as described above, in some cases the addition may beperformed modulo m wherein m=2^(x) wherein each colour value comprises xbits); if the multiple origin and delta compression algorithm was usedto compress the colour value then the common base information comprisesmultiple origin values and the fixed-length parameter comprises an indexidentifying one of the origin values and a delta value representing thedifference between the identified origin value and the colour value, andthe desired colour value is generated by adding the identified originvalue and the delta value (as described above, in some cases theaddition may be performed modulo m wherein m=2^(x) wherein each colourvalue comprises x bits); if the look-up table compression algorithm wasused to compress the colour value then the common base informationcomprises a look-up table with a plurality of colour values and thefixed-length parameter comprises an index that identifies one of thecolour values in the look-up table (i.e. an index to the look-up table),and the colour value that is identified by the index is used as thedesired colour value; and if the predetermined colour compressionalgorithm was used to compress the colour value then the common baseinformation comprises information identifying one of one or morepredetermined colour values, the fixed-length parameter comprises zerobits, and the identified predetermined colour value is used as thedesired colour value.

As described above, when the predetermined colour compression algorithmis used there may be only a single predetermined colour value and thecommon base information may comprise information indicating that thepredetermined colour compression algorithm was used to compress thecolour value. In other cases, there may be a plurality of predeterminedcolour values where one or more of the predetermined colour values arefixed and/or one or more of the predetermined colour values may beconfigurable. In some cases, the common base information may identify aparticular predetermined colour value for more than one channel. Forexample, the common base information may indicate that the colour valuesfor the first channel are a particular predetermined colour value andthe colour values for a second channel are a particular predeterminedcolour value. For example, the common base information may indicate thatthe pixel colour value (i.e. the combination of the channel colourvalues) for the pixels in the compressed block is a predetermined value.

The fixed-length compression algorithm that was used to compress thecolour value may be predetermined, or determined from the header by theheader analysis unit 2502 and then provided to the colour valuegeneration unit 2506.

Test Results

Reference is now made to FIG. 27 which illustrates the results of usingthe described compression method for the Manhattan 3.0 benchmark test.Specifically, FIG. 27 shows the size of the compressed blocks of imagedata (including the header data and the body data) relative to theuncompressed blocks of image data when 32×32 image data blocks werecompressed at a single level of compression—i.e. a 32×32 block, 16×16blocks or 8×8 blocks—using the origin and delta compression method. Itcan be seen at 2702 that when the 32×32 blocks of image data werecompressed in 8×8 blocks the size of the compressed data blocks were 40%of the size of the uncompressed blocks of image data which is a 60%reduction. As shown at 2704, when the 32×32 blocks of image data werecompressed in 16×6 blocks the size of the compressed data blocks were46% of the size of the uncompressed blocks of image data, which is a 54%reduction. As shown at 2706, when the 32×32 blocks of image data werecompressed in 32×32 blocks the size of the compressed data blocks were54% of the size of the uncompressed blocks of image data, which is a 46%reduction. Accordingly, the simpler single level compression has shownto work particularly well for an 8×8 block level.

FIG. 27 also shows at 2708 that when a hierarchical compression methodwas implemented such that 32×32 blocks were compressed at a 16×16 blocklevel if there was a common colour value in the 16×16 block, otherwisethe 8×8 blocks were compressed using the origin and delta compressionalgorithm, the size of the compressed blocks of image data was 39% ofthe size of the uncompressed blocks of image data, which is a 61%reduction. FIG. 27 also shows at 2710 that when a hierarchicalcompression method was implemented such that 32×32 blocks werecompressed at a 32×32 level if there was a common colour value in the32×32 block, if not the 8×8 blocks were compressed using the origin anddelta compression algorithm, the size of the compressed blocks of imagedata was 39% of the size of the uncompressed block of image data, whichis also a 61% reduction. Thus an improvement in the level of compressioncan be achieved with a hierarchical compression scheme, but thisincreases the complexity of the compression and decompression. It wasfound on average that the size of the header was about 7% of the size ofthe compressed blocks of image data.

Reference is now made to FIG. 28 which illustrates the percentage of 8×8blocks that have a common colour value (which are also referred toherein as unique colour blocks) for each of a plurality of benchmarktests for each of a plurality of different block sizes.

Reference is now made to FIG. 29 which illustrates the size of thecompressed blocks of image data (including the header data and the bodydata) relative to the uncompressed blocks of image data when 32×32 imagedata blocks were compressed according to each of the following for eachof a plurality of benchmark tests:

-   -   a single level of compression—8×8 blocks—using the origin and        delta compression algorithm    -   a single level of compression—16×16 blocks—using the origin and        delta compression algorithm    -   a single level of compression—32×32 block—using the origin and        delta compression algorithm    -   Multi-level compression—        -   32×32 block if common value—using the common value            compression algorithm        -   16×16 block if common value—using the common value            compression algorithm        -   8×8 blocks using the origin and delta compression algorithm

FIG. 30 shows a computer system in which the compression units,decompression units, and compression/decompression units describedherein may be implemented. The computer system comprises a CPU 3002, aGPU 3004, a memory 3006 and other devices 3014, such as a display 3016,speakers 3018 and a camera 3020. A processing block 3010 (which may be acompression unit, a decompression unit, or a compression/decompressionunit described herein) is implemented on the GPU 3004. In otherexamples, the processing block 3010 may be implemented on the CPU 3002.The components of the computer system can communicate with each othervia a communications bus 3022.

The compression and decompression units of FIGS. 24-25 are shown ascomprising a number of functional blocks or units. This is schematiconly and is not intended to define a strict division between differentlogic elements of such entities. Each functional block or unit may beprovided in any suitable manner. It is to be understood thatintermediate values described herein as being formed by a block or unitneed not be physically generated by compression or decompression unit atany point and may merely represent logical values which convenientlydescribe the processing performed by the compression or decompressionunit between its input and output.

The compression units, decompression units, and/orcompression/decompression units described herein may be embodied inhardware on an integrated circuit. The compression units, decompressionunits, and/or compression/decompression units described herein may beconfigured to perform any of the methods described herein. Generally,any of the functions, methods, techniques or components described abovecan be implemented in software, firmware, hardware (e.g., fixed logiccircuitry), or any combination thereof. The terms “module,”“functionality,” “component”, “element”, “unit”, “block” and “logic” maybe used herein to generally represent software, firmware, hardware, orany combination thereof. In the case of a software implementation, themodule, functionality, component, element, unit, block or logicrepresents program code that performs the specified tasks when executedon a processor. The algorithms and methods described herein could beperformed by one or more processors executing code that causes theprocessor(s) to perform the algorithms/methods. Examples of acomputer-readable storage medium include a random-access memory (RAM),read-only memory (ROM), an optical disc, flash memory, hard disk memory,and other memory devices that may use magnetic, optical, and othertechniques to store instructions or other data and that can be accessedby a machine.

The terms computer program code and computer readable instructions asused herein refer to any kind of executable code for processors,including code expressed in a machine language, an interpreted languageor a scripting language. Executable code includes binary code, machinecode, bytecode, code defining an integrated circuit (such as a hardwaredescription language or netlist), and code expressed in a programminglanguage code such as C, Java or OpenCL. Executable code may be, forexample, any kind of software, firmware, script, module or librarywhich, when suitably executed, processed, interpreted, compiled,executed at a virtual machine or other software environment, cause aprocessor of the computer system at which the executable code issupported to perform the tasks specified by the code.

A processor, computer, or computer system may be any kind of device,machine or dedicated circuit, or collection or portion thereof, withprocessing capability such that it can execute instructions. A processormay be any kind of general purpose or dedicated processor, such as aCPU, GPU, System-on-chip, state machine, media processor, anapplication-specific integrated circuit (ASIC), a programmable logicarray, a field-programmable gate array (FPGA), or the like. A computeror computer system may comprise one or more processors.

It is also intended to encompass software which defines a configurationof hardware as described herein, such as HDL (hardware descriptionlanguage) software, as is used for designing integrated circuits, or forconfiguring programmable chips, to carry out desired functions. That is,there may be provided a computer readable storage medium having encodedthereon computer readable program code in the form of an integratedcircuit definition dataset that when processed (i.e. run) in anintegrated circuit manufacturing system configures the system tomanufacture a compression unit, decompression unit, orcompression/decompression unit configured to perform any of the methodsdescribed herein, or to manufacture a processor comprising any apparatusdescribed herein. An integrated circuit definition dataset may be, forexample, an integrated circuit description.

Therefore, there may be provided a method of manufacturing, at anintegrated circuit manufacturing system, a compression unit, adecompression unit, and/or compression/decompression unit as describedherein. Furthermore, there may be provided an integrated circuitdefinition dataset that, when processed in an integrated circuitmanufacturing system, causes the method of manufacturing a compressionunit, decompression unit, and/or compression/decompression unit to beperformed.

An integrated circuit definition dataset may be in the form of computercode, for example as a netlist, code for configuring a programmablechip, as a hardware description language defining hardware suitable formanufacture in an integrated circuit at any level, including as registertransfer level (RTL) code, as high-level circuit representations such asVerilog or VHDL, and as low-level circuit representations such as OASIS(RTM) and GDSII. Higher level representations which logically definehardware suitable for manufacture in an integrated circuit (such as RTL)may be processed at a computer system configured for generating amanufacturing definition of an integrated circuit in the context of asoftware environment comprising definitions of circuit elements andrules for combining those elements in order to generate themanufacturing definition of an integrated circuit so defined by therepresentation. As is typically the case with software executing at acomputer system so as to define a machine, one or more intermediate usersteps (e.g. providing commands, variables etc.) may be required in orderfor a computer system configured for generating a manufacturingdefinition of an integrated circuit to execute code defining anintegrated circuit so as to generate the manufacturing definition ofthat integrated circuit.

An example of processing an integrated circuit definition dataset at anintegrated circuit manufacturing system so as to configure the system tomanufacture a compression unit, a decompression unit, and/or acompression/decompression unit will now be described with respect toFIG. 31.

FIG. 31 shows an example of an integrated circuit (IC) manufacturingsystem 3102 which is configured to manufacture a compression unit, adecompression unit, and/or a compression/decompression unit as describedin any of the examples herein. In particular, the IC manufacturingsystem 3102 comprises a layout processing system 3104 and an integratedcircuit generation system 3106. The IC manufacturing system 3102 isconfigured to receive an IC definition dataset (e.g. defining acompression unit, a decompression unit, and/or acompression/decompression unit as described in any of the examplesherein), process the IC definition dataset, and generate an IC accordingto the IC definition dataset (e.g. which embodies a compression units,decompression units, or compression/decompression unit as described inany of the examples herein). The processing of the IC definition datasetconfigures the IC manufacturing system 3102 to manufacture an integratedcircuit embodying a compression unit, a decompression unit, or acompression/decompression unit as described in any of the examplesherein.

The layout processing system 3104 is configured to receive and processthe IC definition dataset to determine a circuit layout. Methods ofdetermining a circuit layout from an IC definition dataset are known inthe art, and for example may involve synthesising RTL code to determinea gate level representation of a circuit to be generated, e.g. in termsof logical components (e.g. NAND, NOR, AND, OR, MUX and FLIP-FLOPcomponents). A circuit layout can be determined from the gate levelrepresentation of the circuit by determining positional information forthe logical components. This may be done automatically or with userinvolvement in order to optimise the circuit layout. When the layoutprocessing system 3104 has determined the circuit layout it may output acircuit layout definition to the IC generation system 3106. A circuitlayout definition may be, for example, a circuit layout description.

The IC generation system 3106 generates an IC according to the circuitlayout definition, as is known in the art. For example, the ICgeneration system 3106 may implement a semiconductor device fabricationprocess to generate the IC, which may involve a multiple-step sequenceof photo lithographic and chemical processing steps during whichelectronic circuits are gradually created on a wafer made ofsemiconducting material. The circuit layout definition may be in theform of a mask which can be used in a lithographic process forgenerating an IC according to the circuit definition. Alternatively, thecircuit layout definition provided to the IC generation system 3106 maybe in the form of computer-readable code which the IC generation system3106 can use to form a suitable mask for use in generating an IC.

The different processes performed by the IC manufacturing system 3102may be implemented all in one location, e.g. by one party.Alternatively, the IC manufacturing system 3102 may be a distributedsystem such that some of the processes may be performed at differentlocations, and may be performed by different parties. For example, someof the stages of: (i) synthesising RTL code representing the ICdefinition dataset to form a gate level representation of a circuit tobe generated, (ii) generating a circuit layout based on the gate levelrepresentation, (iii) forming a mask in accordance with the circuitlayout, and (iv) fabricating an integrated circuit using the mask, maybe performed in different locations and/or by different parties.

In other examples, processing of the integrated circuit definitiondataset at an integrated circuit manufacturing system may configure thesystem to manufacture a compression unit, a decompression unit, or acompression/decompression unit without the IC definition dataset beingprocessed so as to determine a circuit layout. For instance, anintegrated circuit definition dataset may define the configuration of areconfigurable processor, such as an FPGA, and the processing of thatdataset may configure an IC manufacturing system to generate areconfigurable processor having that defined configuration (e.g. byloading configuration data to the FPGA).

In some embodiments, an integrated circuit manufacturing definitiondataset, when processed in an integrated circuit manufacturing system,may cause an integrated circuit manufacturing system to generate adevice as described herein. For example, the configuration of anintegrated circuit manufacturing system in the manner described abovewith respect to FIG. 31 by an integrated circuit manufacturingdefinition dataset may cause a device as described herein to bemanufactured.

In some examples, an integrated circuit definition dataset could includesoftware which runs on hardware defined at the dataset or in combinationwith hardware defined at the dataset. In the example shown in FIG. 31,the IC generation system may further be configured by an integratedcircuit definition dataset to, on manufacturing an integrated circuit,load firmware onto that integrated circuit in accordance with programcode defined at the integrated circuit definition dataset or otherwiseprovide program code with the integrated circuit for use with theintegrated circuit.

The implementation of concepts set forth in this application in devices,apparatus, modules, and/or systems (as well as in methods implementedherein) may give rise to performance improvements when compared withknown implementations. The performance improvements may include one ormore of increased computational performance, reduced latency, increasedthroughput, and/or reduced power consumption. During manufacture of suchdevices, apparatus, modules, and systems (e.g. in integrated circuits)performance improvements can be traded-off against the physicalimplementation, thereby improving the method of manufacture. Forexample, a performance improvement may be traded against layout area,thereby matching the performance of a known implementation but usingless silicon. This may be done, for example, by reusing functionalblocks in a serialised fashion or sharing functional blocks betweenelements of the devices, apparatus, modules and/or systems. Conversely,concepts set forth in this application that give rise to improvements inthe physical implementation of the devices, apparatus, modules, andsystems (such as reduced silicon area) may be traded for improvedperformance. This may be done, for example, by manufacturing multipleinstances of a module within a predefined area budget.

The applicant hereby discloses in isolation each individual featuredescribed herein and any combination of two or more such features, tothe extent that such features or combinations are capable of beingcarried out based on the present specification as a whole in the lightof the common general knowledge of a person skilled in the art,irrespective of whether such features or combinations of features solveany problems disclosed herein. In view of the foregoing description itwill be evident to a person skilled in the art that variousmodifications may be made within the scope of the invention.

What is claimed is:
 1. A method of compressing a block of image data,the block of image data comprising a plurality of image element values,each image element value being divisible into at least a first value anda second value such that the block of image data comprises atwo-dimensional block of first values, the method comprising:compressing a first data set comprising all or a portion of thetwo-dimensional block of first values in accordance with a firstfixed-length compression algorithm to generate a first compressed blockby: identifying common base information for the first data set, andidentifying a fixed-length parameter for each first value in the firstdata set, each first value in the first data set being obtainable fromthe common base information for the first data set and the fixed-lengthparameter for that first value, the fixed-length parameter being zero,one or more than one bits in length; and forming a compressed block forthe block of image data based on the first compressed block by: forminga header for the compressed block of image data, wherein the headercomprises the common base information for the first data set andinformation that indicates a size of the fixed-length parameter for eachfirst value in the first data set, and forming a body for the compressedblock of image data, wherein the body comprises the fixed-lengthparameter for each first value in the first data set.
 2. The method ofclaim 1, wherein the first data set comprises a first portion of thetwo-dimensional block of first values, and the method further comprisescompressing a second data set comprising a second portion of thetwo-dimensional block of first values in accordance with a secondfixed-length compression algorithm to generate a second compressedblock, and wherein the compressed block for the block of image data isfurther based on the second compressed block.
 3. The method of claim 1,further comprising sub-dividing the two-dimensional block of firstvalues into a plurality of sub-blocks, and wherein the first data set isone of the plurality of sub-blocks.
 4. The method of claim 1, furthercomprising, prior to compressing the first data set, selecting the firstdata set by: sub-dividing the two-dimensional block of first values intoa plurality of sub-blocks; determining whether one of the sub-blocks canbe suitably compressed using a fixed-length compression algorithm; inresponse to determining that the one of the sub-blocks can be suitablycompressed using a fixed-length compression algorithm, selecting the oneof the sub-blocks as the first data set; and in response to determiningthat the one of the sub-blocks cannot be suitably compressed using afixed-length compression algorithm, sub-dividing the one of thesub-blocks into a plurality of mini-blocks and selecting one of themini-blocks as the first data set.
 5. The method of claim 1, furthercomprising, prior to compressing the first data set, selecting the firstdata set by: determining whether the two-dimensional block of firstvalues can be suitably compressed using a fixed-length compressionalgorithm; in response to determining that the two-dimensional block offirst values can be suitably compressed using a fixed-length compressionalgorithm, selecting the two-dimensional block of first values as thefirst data set; and in response to determining that the two-dimensionalblock of first values cannot be suitably compressed using a fixed-lengthcompression algorithm, sub-dividing the two-dimensional block of firstvalues into a plurality of sub-blocks and selecting one of thesub-blocks as the first data set.
 6. The method of claim 1, wherein theblock of image data further comprises a two-dimensional block of secondvalues and the method further comprises: compressing a third data setcomprising all or a portion of the two-dimensional block of secondvalues using a third fixed-length compression algorithm to generate athird compressed block by: identifying common base information for thethird data set, and identifying a fixed-length parameter for each secondvalue in the third data set, each second value in the third data setbeing obtainable from the common base information for the third data setand the fixed-length parameter for that second value, the fixed-lengthparameter being zero, one or more than one bits in length; and whereinthe compressed block for the block of image data is further based on thethird compressed block.
 7. The method of claim 1, wherein: the block ofimage data further comprises a two-dimensional block of second values;each first value and each second value correspond to a pixel; and thecompressed block for the block of image data comprises a pixel data unitfor each pixel, the pixel data unit comprising: first data representingthe first value in the two-dimensional block of first valuescorresponding to that pixel, the first data comprising the first valueor a fixed-length parameter for that first value generated in accordancewith a fixed-length compression algorithm, and second data representingthe second value in the two-dimensional block of second valuescorresponding to that pixel, the second data comprising the second valueor a fixed-length parameter for that second value generated inaccordance with a fixed-length compression algorithm.
 8. The method ofclaim 7, wherein the pixel data units are grouped into blocks and thefirst data of each pixel data unit in a block is a same size and thesecond data of each pixel data unit in a block is a same size.
 9. Themethod of claim 1, further comprising: analysing the first values in thefirst data set to generate one or more diversity statistics, the one ormore diversity statistics include one or more of: a range of values inthe first data set, a minimum value in the first data set, a maximumvalue in the first data set, and a number of unique values in the firstdata set; and selecting one of a plurality of fixed-length compressionalgorithms to be the first fixed-length compression algorithm based onthe one or more diversity statistics.
 10. The method of claim 1, whereinif each value of the first data set is the same and matches one of oneor more predetermined values, the common base information comprisesinformation identifying the one of the one or more predetermined valuesand the fixed-length parameter for each value has zero bits.
 11. Themethod of claim 10, wherein the one or more predetermined valuescomprises a plurality of values and at least a portion of the pluralityof values are dynamically configurable.
 12. The method of claim 1,wherein: the block of image data further comprises a two-dimensionalblock of second values; and if all of the values of the first data setare the same and match a first predetermined value, and all the valuesof a third data set are the same and match a second predetermined value,wherein the third data set comprises the second values of thetwo-dimensional block of second values corresponding to the values inthe first data set, then the common base information comprisesinformation identifying the first and second predetermined values andthe fixed-length parameters have zero bits.
 13. The method of claim 1,wherein the common base information comprises an origin based on thevalues in the first data set and the fixed-length parameter for eachvalue comprises a difference between the value and the origin.
 14. Themethod of claim 1, wherein the common base information comprises aplurality of origins based on the values in the first data set and thefixed-length parameter for each value comprises an index identifying oneof the plurality of origins and a difference between the value and thatorigin.
 15. The method of claim 1, wherein the common base informationcomprises a look up table of unique values in the first data set and thefixed-length parameter for a value comprises an index to the look uptable.
 16. The method of claim 1, wherein if all the values in the firstdata set are the same, the common base information comprises that commonvalue and the fixed-length parameter for each value has zero bits. 17.The method of claim 1, wherein the header further comprises informationindicating the first fixed-length compression algorithm.
 18. The methodof claim 1, wherein each image element value is a colour value and eachfirst value is a colour value for a first colour channel.
 19. Acompression unit configured to compress a block of image data, the blockof image data comprising a plurality of image element values, each imageelement value being divisible into at least a first value and a secondvalue such that the block of image data comprises a two-dimensionalblock of first values, the compression unit comprising: a headergeneration unit configured to identify common base information forcompressing a first data set according to a first fixed-lengthcompression algorithm, the first data set comprising all or a portion ofthe two-dimensional block of first values; and a body generation unitconfigured to: identify a fixed-length parameter for each first value inthe first data set according to the first fixed-length compressionalgorithm, each first value being obtainable from the common baseinformation for the first data set and the fixed-length parameter forthat first value, and form a compressed block for the block of imagedata based on the common base information and the fixed-lengthparameters by: forming a header for the compressed block of image data,wherein the header comprises the common base information for the firstdata set and information that indicates a size of the fixed-lengthparameter for each first value in the first data set, and forming a bodyfor the compressed block of image data, wherein the body comprises thefixed-length parameter for each first value in the first data set.
 20. Anon-transitory computer readable storage medium having stored thereoncomputer readable instructions that, when executed at a computer system,cause the computer system to perform the method as set forth in claim 1.